SQL QuestSQL Interview Questions › Joins

Big-Ticket Sales with Properties

MediumFreeQuerying BasicsJoins

JOIN sales with sales_legals to show DEED documents above $10M along with their bbl, street_number, street_name, document_amt, document_date. Order by document_amt descending. Top 15.

Solve it in the browser editor →

Runs on SQLite in your browser, graded against the expected result, no signup. A wrong answer gets a diagnosis, not just "incorrect".

Schema

sales

document_idrecord_typedoc_typerecorded_boroughdocument_datedocument_amtrecorded_datetime
2025081800333001ADEED12025-08-1410800000002025-08-18
2024012300948001ADEED12024-01-229630000002024-01-24
2025081800439001ADEED12025-08-148100000002025-08-20

sales_legals

document_idbblproperty_typestreet_numberstreet_nameunit
20260302001740052059330225CR5921PALISADE AVENUENULL
20260311003440133024141401OT280KENT AVENUENRU
20260302004230053043930001AP180WORTMAN AVENUENULL

Expected output: Big NYC deals with property linkage

Hint

JOIN sales s ON s.document_id = l.document_id WHERE s.doc_type='DEED' AND s.document_amt > 10000000.

Concepts

SELECT JOIN WHERE

Practise the topic: SQL practice questions · JOIN practice

Related questions

Customers Who Never OrderedMedium · FreeAbove-Average Departments (Derived Table)Medium · FreeLEFT JOIN NULL Semantics: Inactive CustomersMedium · FreeManagement Hierarchy OverviewMedium · FreeCount Direct ReportsMedium · FreeCustomer Recency AnalysisMedium · Free

Where would this cost you points in an interview?

Ten questions, no signup: a Skillmap across nine SQL skills and the one to fix first.

Take the readiness test