Free practice · Interactive SQL · easy

Practice

Preview the orders table

Complete the read-only preview so it returns order_id, customer_id, order_date, and status in that order. Keep the five-row limit.

Practice database

US retail practice database

A small fictional customer and order database designed for hand-checkable beginner queries.

Runs locally in your browser
Table relationships
orders.customer_idcustomers.customer_idorder_items.order_idorders.order_id

customers

Customer profile fields used for service and reporting.

3 rows

Grain One row per customer

  • customer_idTEXTPK
  • customer_nameTEXT
  • state_codeTEXT
  • segmentTEXT
Preview source rows
customer_idcustomer_namestate_codesegment
C-018Lakeview DentalILSmall Business
C-031Mesa Office SupplyAZMidmarket
C-044Harbor Design StudioMASmall Business

orders

Order-level dates, statuses, and amounts.

4 rows

Grain One row per order

  • order_idTEXTPK
  • customer_idTEXTFK
  • order_dateTEXT
  • statusTEXT
  • order_amountREAL
Preview source rows
order_idcustomer_idorder_datestatusorder_amount
O-1041C-0182026-04-02Shipped420
O-1042C-0312026-04-02Processing615
O-1043C-0182026-04-03Canceled180

order_items

Product-level line items belonging to an order.

5 rows

Grain One row per product on an order

  • order_idTEXTFK
  • product_idTEXT
  • quantityINTEGER
  • unit_priceREAL
Preview source rows
order_idproduct_idquantityunit_price
O-1041P-112100
O-1041P-181220
O-1042P-113100

SQL editor

Write one read-only query

SELECT and WITH only
Changes to this practice database are never saved.
Ready to check your work?Edit the starter query, run it, then compare your result with the task.