INTERACTIVE SQL EXERCISES

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.

4 questions free, no account 7 days of everything after signup No card needed
HOW BIG IS EACH TEAM, AND WHAT DOES IT COST?SAMPLE DATA
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;
departmentpeopleavg_salary
Engineering11100091
Sales674000
Marketing480250
Finance383000
Leadership1168000
Research0null
Correct. LEFT JOIN keeps departments that have nobody in them yet.
136exercises
5company datasets
20courses
12hof practice
78 new exercises in the last 30 days · last update 30 October. New business cases are added regularly. Every addition is listed with the date it went live.What's new
BEYOND THE BASICS

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.

Explore Defend the number
LEARN SQL BY DOING

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.

Explore all 14 courses
NEW: INTERVIEW PRACTICE

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 tracks
HOW IT WORKS

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

01

Read the question

A real business question, with the tables you need listed beside the editor.

02

Write and run your query

See the result instantly. Preview any table to understand the data.

03

Check your answer

Get told exactly what is off: missing rows, wrong columns, the wrong order. Then compare with our solution.

WHY SQL, AND WHY LIKE THIS

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

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

START TODAY

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.