Skip to content
RED SAGSkills

High-Value Delivered Orders

The orders table holds one row per order. status is always lowercase: pending, shipped, delivered or cancelled.

Find every order that has been delivered and whose amount is at least 500.

Return columns order_id, customer_id, amount. Order by amount descending, then order_id ascending.

Schema

CREATE TABLE orders (
  order_id INTEGER PRIMARY KEY,
  customer_id INTEGER NOT NULL,
  amount REAL NOT NULL,
  status TEXT NOT NULL,
  order_date TEXT NOT NULL
);

Sample data

orders

order_idcustomer_idamountstatusorder_date
1101250delivered2026-01-03
2102780.5delivered2026-01-04
31031200cancelled2026-01-05
4101640shipped2026-01-06
5104915.25delivered2026-01-07
6105499.99delivered2026-01-08
71021500delivered2026-01-09
810660pending2026-01-10
Hint 1

Both conditions go in the WHERE clause, joined with AND.

Hint 2

"At least 500" means >= 500, so an order of exactly 500 counts.

Good practice for: Data Analyst, Business Analyst, Backend Developer

SQL (SQLite)

Run checks your query on the sample data (Ctrl + '). Submit also checks hidden databases.