Sign in to run and submit your work
Reading is open to everyone. Running code and saving drafts need an account so your work is yours and comes back on your next visit.
or
CODE WORKSPACE
Return order_id, status, and total_amount for orders that are paid or shipped, were created in January 2026, and have total_amount of at least 100. Order by order_id.
Result columns · in this order
order_id | Order identifier; unique in this table. |
status | Order status: paid, shipped, pending, or refunded. |
total_amount | Order total in dollars. |
How to approach it
Filter on status IN ('paid','shipped'), a half-open January range on created_at, and total_amount >= 100, then ORDER BY order_id.
Sample input
| order_id | status | total_amount | created_at |
|---|---|---|---|
| 1001 | paid | 80 | 2026-01-12 08:40:00 |
| 1002 | paid | 120 | 2026-01-12 10:02:00 |
| 1003 | pending | 40 | 2026-01-13 11:15:00 |
| 1004 | shipped | 220 | 2026-01-15 14:20:00 |
| 1005 | paid | 540 | 2026-01-18 09:05:00 |
| 1008 | shipped | 150 | 2026-01-25 12:00:00 |
| 1010 | paid | 640 | 2026-01-30 21:10:00 |
| 1011 | paid | 110 | 2026-02-02 09:00:00 |
8 rows — all rows shown.
Expected output
| order_id | status | total_amount |
|---|---|---|
| 1002 | paid | 120 |
| 1004 | shipped | 220 |
| 1005 | paid | 540 |
| 1008 | shipped | 150 |
| 1010 | paid | 640 |
5 rows — all rows shown.
Constraints
Use IN for the status set. Use a half-open date range (created_at >= '2026-01-01' AND created_at < '2026-02-01') so the February orders are excluded. Keep the status set grouped so precedence is unambiguous.
Expected skills
Membership filters with IN, half-open date ranges on text timestamps, and combining AND conditions without precedence bugs.
Submit for review to find out what your query gets right, what it gets wrong, and how it compares with the best working query for this exercise.
This scenario runs a full workspace — editor, canvas and results side by side. It needs a laptop or desktop to be usable. Open this page on a bigger screen to start building.