Free practice · Interactive SQL · medium
Practice
Build a safe customer preview
Replace SELECT * with the three needed fields: customer_id, customer_name, and state_code. Preserve the five-row limit.
Table relationshipsorders.customer_id→customers.customer_idorder_items.order_id→orders.order_id
customers
Customer profile fields used for service and reporting.
3 rowsGrain One row per customer
customer_idTEXTPKcustomer_nameTEXTstate_codeTEXTsegmentTEXT
Preview source rows
orders
Order-level dates, statuses, and amounts.
4 rowsGrain One row per order
order_idTEXTPKcustomer_idTEXTFKorder_dateTEXTstatusTEXTorder_amountREAL
Preview source rows
order_items
Product-level line items belonging to an order.
5 rowsGrain One row per product on an order
order_idTEXTFKproduct_idTEXTquantityINTEGERunit_priceREAL
Preview source rows
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.