Beginner#04 · Date ranges
March orders
Finance is closing the books for March 2026. Return the order_id and order_date of every order placed in that month, oldest first.
Write your query in the lab. It runs in your browser and tells you exactly what's wrong if it doesn't match.
Solve it in the labHints
Hint 1
Dates are stored as text like '2026-03-14', so they sort and compare correctly.
Hint 2
Try order_date BETWEEN '2026-03-01' AND '2026-03-31'. If two orders share a date, break the tie with order_id.
Expected output
Your result should match this, in this order (8 rows).
| order_id | order_date |
|---|---|
| 83 | 2026-03-04 |
| 84 | 2026-03-08 |
| 85 | 2026-03-16 |
| 86 | 2026-03-21 |
| 87 | 2026-03-24 |
| 88 | 2026-03-26 |
| 89 | 2026-03-29 |
| 90 | 2026-03-31 |
Model answer
Show the solution
SELECT order_id, order_date FROM orders WHERE order_date BETWEEN '2026-03-01' AND '2026-03-31' ORDER BY order_date, order_id;
Other queries that return the same rows are correct too. The lab checks your result, not your exact wording.