Big delivered orders
EasyFiltering and sortingE-commerce
The problem
List the order_id, customer_id and amount of every delivered order worth at least 1000.
Show the highest amounts first. If two orders have the same amount, show the smaller order_id first.
Learn this in the course: SELECT, WHERE and ORDER BY (video and notes)
Tables · Online shop
Click a table or column name to insert it into your query.
- INTEGER · primary key
- TEXT
- TEXT · can be NULL
- DATE
Sample rows (10 total)
| customer_id | name | city | signup_date |
|---|---|---|---|
| 1 | Aarav Mehta | Mumbai | 2025-01-10 |
| 2 | Diya Nair | Bengaluru | 2025-01-18 |
| 3 | Kabir Singh | Delhi | 2025-02-02 |
| 4 | Meera Iyer | Chennai | 2025-02-14 |
| 5 | Rohan Das | Kolkata | 2025-03-01 |
- INTEGER · primary key
- INTEGER · → customers
- DATE
- TEXT · delivered | cancelled | returned | pending
- INTEGER · rupees
Sample rows (20 total)
| order_id | customer_id | order_date | status | amount |
|---|---|---|---|---|
| 1 | 1 | 2025-05-01 | delivered | 1200 |
| 2 | 1 | 2025-05-15 | delivered | 800 |
| 3 | 1 | 2025-06-02 | cancelled | 500 |
| 4 | 2 | 2025-05-03 | delivered | 2500 |
| 5 | 2 | 2025-05-20 | delivered | 450 |
Ctrl/⌘ + Enter runs the query. Table and column names are suggested as you type. Press Esc then Tab to leave the editor with the keyboard.
Expected output (7 rows)
| order_id | customer_id | amount |
|---|---|---|
| 15 | 6 | 3200 |
| 4 | 2 | 2500 |
| 6 | 2 | 1800 |
| 10 | 4 | 1500 |
| 11 | 4 | 1500 |
| 1 | 1 | 1200 |
| 17 | 6 | 1100 |
Row order matters for this question. Numbers are compared with a tiny tolerance; text must match exactly.
Stuck?
Stored on this device only. Your latest query and “solved” status are remembered in this browser only. They don’t sync between devices, and clearing your browser data removes them.