Product Dojo · SQL

The SQL Dojo

Twenty-two stages from your first SELECT to window functions. Read the lesson, write the query, pass the checks.

Nothing to install

A real database, running in this tab

Every editor on the site runs actual SQLite, compiled to WebAssembly and loaded once into your browser. Not a simulation and not a subset — real joins, real window functions, and real error messages when you get a column name wrong.

Nothing you write leaves your browser, and the database is rebuilt from scratch before every single run. A DELETE with the wrong WHERE clause costs you one press of the Run button, which is the safest possible place to make that mistake for the first time.

One database, all the way through

Northwind Analytics

A small SaaS product's database: who signed up, what they subscribed to, what they bought, and what they did in the app. Every stage queries the same five tables, so your attention goes on the SQL rather than on re-learning a schema each time — which is also how the job works.

It is deliberately small enough to check by eye. When a query returns seven rows you can go and count the seven, which is the fastest way there is to learn what a join actually did.

How a SQL stage is trained

Every stage has the same five parts. You read, you query, you get checked — and the boss round is a query, not a quiz.

Learn

Four short lessons in plain language, with worked queries and a quick check at the end of each. No jargon left undefined, and no prior database experience assumed.

Lab

Four queries you type into a real editor, against the real database. Press Run and you get the result table plus checks comparing it to the expected answer — so "nearly right" is told apart from right.

Bonus

Name the concept from its clues. The fewer clues you need, the more points.

Boss

One graded query with visible and hidden checks, so it is cleared by answering the question rather than by shaping a query around the examples.

Intel

The whole stage condensed onto one screen — the syntax, the traps and the error messages — for when you are half-way through something else.

Four worlds

World 1

Reading Data

6 stages

Can pull exactly the rows and columns wanted out of a table: selecting, filtering, sorting, de-duplicating, and handling the NULLs that break naive conditions.

Clear it all and you earn Query Reader

World 2

Summarising

5 stages · in the works

Can turn rows into numbers: counts, sums and averages, grouped by any dimension, filtered after the fact, and sliced by time.

Clear it all and you earn Aggregate Analyst

World 3

Combining

6 stages · in the works

Can bring several tables together without losing or duplicating rows, and knows when a subquery, a CTE or a join is the right shape.

Clear it all and you earn Join Wrangler

World 4

Analyst SQL

5 stages · in the works

Can rank, compare a row to its neighbours, build running totals, express a funnel or a retention cohort in SQL, and change data safely.

Clear it all and you earn Window Master

The full curriculum

Twenty-two stages across four worlds, in order — each one leans on the one before it. World 1 is open now; the rest are released world by world.

2. Summarising

  • 2-01COUNT, SUM & AVG
  • 2-02GROUP BY
  • 2-03HAVING & Filter Order
  • 2-04Working with Dates
  • 2-05Text & Number Functions

3. Combining

  • 3-01INNER JOIN
  • 3-02LEFT JOIN & Missing Rows
  • 3-03Joining Three Tables
  • 3-04Self Joins & UNION
  • 3-05Subqueries
  • 3-06Common Table Expressions

4. Analyst SQL

  • 4-01Window Functions
  • 4-02Running Totals, LAG & LEAD
  • 4-03Funnels & Cohorts
  • 4-04INSERT, UPDATE & DELETE
  • 4-05Capstone: The Monthly Report

No prior database experience needed

Write your first query

Free to join. Your rank and cleared stages stay with you across every device, and count towards the same belt as every other dojo. Clear all 22 and you earn the SQL Practitioner certificate.

Enter the SQL dojo

Want to write programs as well? Try the Python dojo.