SQL basics: ask your first questions
Pull exactly the rows and columns you need from a business table: filter, sort, pick the top N, spot missing data and search text without touching a spreadsheet.
Start course→ 02
→ 03
Your exercises
01The B2B sales team wants to phone every business customer this week. Return the name and email (in that order) of every customer whose segment is 'business'.
The app team wants to know which orders placed through the app were actually paid. Return the order id and order_date of every order whose channel is 'app' and whose status is 'paid'.
An office manager can spend less than €400 per item on furniture and computers for a new hire. Return name, category and price of every product in the 'Office' or 'Computers' category with a price below 400.
For a "premium picks" banner, marketing wants the five most expensive products in the catalogue. Return name and price, sorted from the highest price to the lowest, and only the top 5 rows.
Finance needs to know in which countries we have business customers, to check VAT registrations. Return one column, country, with each country listed once, sorted alphabetically (A to Z).
Most customers registered with a country email domain such as example.de, but some used the generic example.com. Return name and email of every customer whose email ends with '@example.com'.
Shipping estimates need a city, and some customer records are incomplete. Return name and country of every customer whose city is missing (NULL).
The e-commerce lead wants every order placed in Q2 2026 (1 April to 30 June, both days included) through our own channels, 'web' or 'app', whatever the status. Return id, order_date and channel.