SQL practice on a real database, checked as you go
Write queries in the browser against an airline database with 4.1 million rows. Every answer is checked against the expected result, from your first SELECT to window functions, retention and interview tasks.
No card needed. All the theory and the first module are free; a pass opens every Nomto course.
- 82 lessons, 248 tasks
- PostgreSQL syntax
- An AI tutor in every task
-- the five busiest routes by passengers
SELECT a.city || ' → ' || b.city AS route,
COUNT(*) AS passengers
FROM ticket_flights tf
JOIN flights f ON f.flight_id = tf.flight_id
JOIN airports a ON a.airport_code = f.departure_airport
JOIN airports b ON b.airport_code = f.arrival_airport
GROUP BY route
ORDER BY passengers DESC
LIMIT 5;| route | passengers |
|---|---|
| Moscow → St. Petersburg | 37575 |
| St. Petersburg → Moscow | 35427 |
| Moscow → Novosibirsk | 29063 |
| Novosibirsk → Moscow | 28239 |
| Moscow → Sochi | 23098 |
5 rows
Two tracks: from zero to interview level
Start with Basics if SQL is new to you. If you already write joins and GROUP BY, go straight to Advanced.
SQL Basics
Everything an analyst writes every day, in the order it builds up.
- How data is organized
- SELECT: first queries
- WHERE: filtering rows
- Functions: numbers, strings and dates
- GROUP BY and HAVING
- JOIN
- CASE and NULL
- Subqueries and CTEs
- UNION and two capstone projects
Advanced SQL
The queries that analytics teams and interviewers actually ask for.
- Window functions: ranks, shares, running totals
- Date spines: dates without gaps
- Self and full joins, recursion
- Window frames and percentiles
- Gaps and islands
- Sessions and paths
- ROLLUP and CUBE
- JSON and arrays
- Change history (SCD2)
- Data quality
- DAU, retention and LTV
- Experiments and A/B tests
- Interview tasks
- Two capstone projects
Short theory, a walkthrough, three tasks
Short theory
One idea per lesson, with an example query you can run and the key points to remember.
Line-by-line walkthrough
A complete query taken apart line by line: what each clause does and why it is there.
Three tasks
A warm-up, a core task and a stretch task. Each comes with a starter query, two hints and the answer when you need it.
A task, and what the checker tells you
A query that runs is not always a right one. The checker compares your result with the expected one and says what is off: a wrong column, extra rows, the order.
Warm-up · GROUP BY and HAVING
Which airports have more than 400 departures over the whole period? Sort by flights_count, highest first.
Expected columns: departure_airport flights_count
FROM flights
Your query
SELECT departure_airport,
COUNT(*) AS flights_count
FROM flights
GROUP BY departure_airport
HAVING COUNT(*) >= 400
ORDER BY flights_count DESC;✗ 19 rows instead of 18. The extra one is Khabarovsk (KHV) with exactly 400 departures: “more than 400” is >, not >=.
✓ HAVING COUNT(*) > 400 — Correct: 18 airports. Only five have more than a thousand departures.
A real airline database, not ten toy rows
Flights, bookings, tickets and boarding passes, plus the loyalty program, app events and A/B experiments, so the analytics tasks have something to analyze.
14 tables
4.1M rows
- Based on the Postgres Professional demo database, a standard for teaching SQL.
- You write PostgreSQL, the dialect most analytics teams use.
- Queries run in a read-only sandbox: nothing to install, nothing you can break.
Help when you are stuck, room to experiment
AI tutor in every task
Ask why your query fails. The tutor sees the task and your result, and points you to the fix instead of handing you the answer.
Playground
A free console over the whole database, with the table schema next to it. Try your own questions.
Syntax reference
Short cards for every clause and function used in the course, linked from the lessons.
Built for people who will use SQL at work
- Aspiring and junior data analysts
- Anyone preparing for an SQL interview
- Marketers and product managers who want answers without waiting for an analyst
Start free, open everything with a pass
Free
- All theory and walkthroughs
- The first module of SQL Basics
- 30 checks to try the course (10 without an account)
- 3 tutor questions (1 without an account)
With the Nomto pass
- All 25 modules and 248 tasks
- Checks without a daily limit
- More tutor questions
- Every other Nomto course too
One pass for all Nomto courses. Prices are shown in the room at checkout.
Explanations in English, Spanish, Russian, Chinese, Portuguese or Vietnamese
SQL is the same everywhere. Theory, hints and the tutor speak the language you choose in the room; table and column names stay as they are.
SQL guides
- Basic SQL queries: SELECT, WHERE, ORDER BY, GROUP BY and JOIN for beginners
- Data analyst roadmap: what to learn, in what order, and how long it takes
- ROW_NUMBER vs RANK vs DENSE_RANK in SQL: the difference on ties
- SQL aggregate functions: COUNT, SUM, AVG, MIN, MAX with examples
- SQL CASE WHEN: conditional logic, categories and conditional aggregation
- SQL cheat sheet for data analysts: every clause and function with a runnable example
Questions
Do I need to install anything?
No. Every query runs in your browser against our database in a read-only sandbox. You need only a browser; a laptop is more comfortable than a phone for writing SQL.
Is it suitable for complete beginners?
Yes. SQL Basics starts with how data is organized in tables and your first SELECT. Each lesson is short theory, a walkthrough and three tasks that go from a warm-up to a stretch.
Which SQL dialect do you teach?
PostgreSQL syntax, the dialect most analytics teams use. What you learn carries over to BigQuery, Snowflake, Redshift and MySQL with small differences.
Are there answers to the exercises?
Yes. Every task has two hints and a reference answer, and after a correct check you see a note on what the result means. The checker also says what is wrong with your result: a wrong column, extra rows or the order.
Will it help with SQL interviews?
Advanced SQL has a module of interview tasks, and the topics interviewers ask about most have their own modules: window functions, gaps and islands, sessions, retention and experiments.
What is free?
All theory and walkthroughs, the first module of SQL Basics, and a free trial of 30 checks and 3 tutor questions with an account (10 checks and 1 question without one). The Nomto pass opens every module and every Nomto course; prices are shown in the room at checkout.
Write your first query
The first lesson takes a few minutes. Your first checked answer shows how it works.