SQL Quest › SQL Interview Questions › Joins
Big-Ticket Sales with Properties
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_id | record_type | doc_type | recorded_borough | document_date | document_amt | recorded_datetime |
|---|---|---|---|---|---|---|
| 2025081800333001 | A | DEED | 1 | 2025-08-14 | 1080000000 | 2025-08-18 |
| 2024012300948001 | A | DEED | 1 | 2024-01-22 | 963000000 | 2024-01-24 |
| 2025081800439001 | A | DEED | 1 | 2025-08-14 | 810000000 | 2025-08-20 |
sales_legals
| document_id | bbl | property_type | street_number | street_name | unit |
|---|---|---|---|---|---|
| 2026030200174005 | 2059330225 | CR | 5921 | PALISADE AVENUE | NULL |
| 2026031100344013 | 3024141401 | OT | 280 | KENT AVENUE | NRU |
| 2026030200423005 | 3043930001 | AP | 180 | WORTMAN AVENUE | NULL |
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