All courses
Beginner

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.

8 exercises · 26 minutes · Data: Online shop
Start course
SQL
01
→ 02
→ 03

Your exercises

01
Call list of business customersFree

The 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'.

2 min
02
Paid orders from the mobile app

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'.

3 min
03
Kit out a new hire under €400

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.

4 min
04
Five most expensive products

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.

3 min
05
Countries with business customers

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).

3 min
06
Customers on a generic email domain

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'.

3 min
07
Customers with no city on file

Shipping estimates need a city, and some customer records are incomplete. Return name and country of every customer whose city is missing (NULL).

3 min
08
Q2 orders from our own channels

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.

5 min
Queries run on sample company data in SQLite. Core SELECT, JOIN and GROUP BY patterns transfer to other SQL engines; functions, dates and types can differ.