Lab: querying basics
Write real queries against the shop and have them checked instantly.
- Combine SELECT, WHERE, ORDER BY, and GROUP BY on real data
- Write queries that pass an automatic result-set check
Optional lab. Write each query and hit Check — your result is compared against the correct one (right number of columns, right rows; order is only checked when the task asks for it). Everything runs on a real SQLite database in your browser. Use Run anytime to see your current output.
These three exercises use the shop dataset (customers, products,
orders, order_items).
Checkpoint 1 — filter rows
Return the name of every customer whose country is the UK.
Remember: string values need single quotes — 'UK', not "UK".
Checkpoint 2 — filter and sort
Here order matters, so the check is strict about it.
Return the name and price of products costing more than 4, sorted from most to least expensive.
Checkpoint 3 — group and count
Return each country and how many customers it has (two columns: the country and the count).
Done?
Three green checks and you can read data fluently — filter, sort, and summarise. The intermediate track combines multiple tables with joins.