Layout

Completed orders over $100

PROBLEM 1 / 24 · BASICAll problems ↗

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.

Outputorder_idorder_total_cents

query.sql

DuckDB SQL

Restoring your saved draft…

⌘ / Ctrl + Enter to run

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_id
  • status completed / cancelled / pending

Fictional teaching data. Money is USD cents; timestamps are UTC.