Completed orders over $100
Return completed orders worth strictly more than $100. All money is USD stored in cents: $100 = 10000 cents. Return order_id and order_total_cents, sorted by order_id ascending.
Output
order_idorder_total_centsquery.sql
DuckDB SQLRestoring your saved draft…
Run a query to see results.
Reveal solution & explanation
SELECT order_id, order_total_cents FROM orders WHERE status = 'completed' AND order_total_cents > 10000 ORDER BY order_id;
Filter the business status explicitly. A high-value cancelled order is not completed revenue, and cents are not dollars.
Data & schema
- order_id
- INTEGER · PK
- customer_id
- INTEGER
- ordered_at
- TIMESTAMP
- status
- VARCHAR
- order_total_cents
- INTEGER
Table notes & relationships
One row per order. Only completed orders count as revenue unless a question says otherwise. Times are UTC.
customer_id→ customers.customer_idstatuscompleted / cancelled / pending
Fictional teaching data. Money is USD cents; timestamps are UTC.