SQL QuestSQL Interview Questions › Date Functions

2025 Sales

EasyFreeQuerying BasicsDate Functions

Show all DEED documents recorded in 2025 in our sales sample. document_date is text in YYYY-MM-DD format. Return document_id, document_date, document_amt for top 15 by document_amt descending (break ties by document_id ascending).

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

Expected output: Largest 2025 deals

Hint

WHERE doc_type = 'DEED' AND document_date LIKE '2025-%' (or use SUBSTR).

Concepts

SELECT WHERE Date Functions ORDER BY

Practise the topic: SQL practice questions · Date function practice

Related questions

Monthly Order CountEasy · FreeJanuary 2024 OrdersEasy · FreePre-1900 BanksEasy · FreeSpend by Day of WeekEasy · FreeThe Ledger's First Week, Day by DayEasy · FreeEmployee Tenure BandsMedium · 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