Learn SQL the way you learned Excel:
by doing.
Start with simple queries, then work through questions using sample data. Write and run SQL in your browser, see what your query returns, and get feedback right away. Practise for work, projects, or interviews at your own pace.
SELECT d.name AS department,
COUNT(e.id) AS people,
ROUND(AVG(e.salary)) AS avg_salary
FROM departments d
LEFT JOIN employees e ON e.department_id = d.id
GROUP BY d.name
ORDER BY people DESC;| department | people | avg_salary |
|---|---|---|
| Engineering | 11 | 100091 |
| Sales | 6 | 74000 |
| Marketing | 4 | 80250 |
| Finance | 3 | 83000 |
| Leadership | 1 | 168000 |
| Research | 0 | null |
Get the number right, then explain why.
Practise the SQL traps that quietly change a result: duplicate rows after a join, missing values and definitions that sound alike.
From your first SELECT to window functions.
Every exercise is a business question on data from an online shop, a software company, a company team, a marketing team or a sales pipeline. Start anywhere; each course builds on the one before.
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.
Totals, averages and groups
Turn raw rows into the numbers a manager asks for: counts, revenue, average order value, monthly trends and rates per group.
Join tables like an analyst
Combine customers, orders, products and people into one answer, find what is missing with LEFT JOIN, and keep your totals honest when tables multiply rows.
Clean messy data before you trust it
Fix messy emails, fill in missing values, catch duplicate customers, bucket values into bands and measure time between dates, so the numbers you report hold up.
Existence, sets and safe NULLs
Answer yes-or-no questions across tables with EXISTS, find missing relationships, combine lists with UNION, and keep missing values from corrupting reports.
Business metrics with SQL
Calculate paid invoice revenue, active paying customers, churn, unpaid invoices and support times from raw tables, with definitions you can defend.
Know the query. Explain the number.
Prepare for SQL screens in finance, analytics, product, marketing and engineering. Practise the question, then explain your assumptions and edge cases as you would to an interviewer.
Explore 6 role tracksPractise SQL from your first minute.
Type a query, run it against a sample database, and see the result straight away. When you check your answer, you learn what worked, what needs fixing, and why.
Read the question
A real business question, with the tables you need listed beside the editor.
Write and run your query
See the result instantly. Preview any table to understand the data.
Check your answer
Get told exactly what is off: missing rows, wrong columns, the wrong order. Then compare with our solution.
Learn SQL one question at a time
SQL helps you explore data, answer questions, and understand the numbers behind apps and dashboards. Whether you are learning a new skill, building a project, preparing for an interview, or using data at work, the best way to get comfortable is to write queries yourself.
SQL Exercises teaches the SQL behind business decisions and role-based interviews: how many customers signed up last month, which accounts churned, what the average order value is by country, whether a customer was billed twice. You practise on five sample datasets: an online shop, a subscription software company, a company team, a marketing team and a sales pipeline.
What you will be able to do
- Filter, sort and summarise tables with SELECT, WHERE, ORDER BY and GROUP BY.
- Combine tables with JOINs, test relationships with EXISTS, and combine lists with UNION.
- Separate contracted MRR from invoice collections, and check churn and duplicate billing.
- Use CTEs and window functions for running totals, rankings and month-over-month change.
- Clean messy data: duplicate customers, missing values, inconsistent text.
Short exercises that fit around your day
Each exercise takes a few minutes. Your progress is saved, so you can do one on a coffee break and pick up exactly where you left off. Wrong answers are part of learning: you get a specific explanation of what is different from the correct result, a hint when you want one, and our solution with an explanation once you solve it.
Topics covered
SELECT · WHERE · ORDER BY · DISTINCT · NULL · LIKE, IN and BETWEEN · COUNT, SUM and AVG · GROUP BY · HAVING · Dates · INNER JOIN · LEFT JOIN · Self join · CASE WHEN · Subqueries · EXISTS · UNION · COALESCE · CTEs (WITH) · Window functions · Text functions
Your first query takes two minutes.
Try 4 exercises free without an account. Then get seven days of full access with no card, and continue for €10 a month if it helps.