SQL practice · runs in your browser

Learn SQL by writing it.

85 hands-on challenges on four real databases. Write a query, run it, and get feedback that tells you exactly what's off. No signup, no setup.

  • 34 challenges free
  • 79 bite-size lessons
  • Progress saved in your browser
department_report.sql employees
Challenge

Which departments have more than 5 employees? Return department_name and total_employees, biggest first.

 
Challenges
85
Lessons
79
Databases
4
Tables to query
29
Accounts needed
0
Instant feedback

Wrong answers that teach.

Most practice sites stop at "incorrect". Query Dojo compares your result with the expected one and tells you what's different: a missing alias, extra rows, the wrong column order, a filter that let too much through.

Every query runs on a real SQLite engine inside your browser, so results come back in milliseconds, even offline.

  1. Attempt 1 Not quite
    SELECT d.name AS department_name, COUNT(*)
    FROM employees e
    JOIN departments d ON e.department_id = d.id
    GROUP BY d.name
    HAVING COUNT(*) > 5;

    Your column 'COUNT(*)' should be named 'total_employees' - add AS total_employees.

  2. Attempt 2 Not quite
    SELECT d.name AS department_name, COUNT(*) AS total_employees
    FROM employees e
    JOIN departments d ON e.department_id = d.id
    GROUP BY d.name;

    Expected 3 rows, you returned 5. 2 rows shouldn't be there.

  3. Attempt 3 Solved · +10
    SELECT d.name AS department_name, COUNT(*) AS total_employees
    FROM employees e
    JOIN departments d ON e.department_id = d.id
    GROUP BY d.name
    HAVING COUNT(*) > 5
    ORDER BY total_employees DESC;
Progression

From white belt to black.

Every challenge, lesson and daily streak earns points. Your belt shows how far you've come, the same way it does in the Query Dojo app.

  1. White Start
  2. Yellow 100 pts
  3. Orange 300 pts
  4. Green 700 pts
  5. Blue 1,400 pts
  6. Black 2,500 pts

Then ten dans. Each one adds a red stripe to your black belt, from 2,500 to 30,000 pts.

  • +10 per challenge
  • +5 per lesson
  • +15 daily challenge bonus
  • +5 per day in your longest streak
transaction.sql The Atomic Stock Transfer
BEGIN;
UPDATE product_inventory SET current_stock = current_stock - 50 WHERE product_id = 1;
UPDATE product_inventory SET current_stock = current_stock + 50 WHERE product_id = 3;
COMMIT;
Forget the COMMIT and everything rolls back
Beyond SELECT

Practice the queries that change data.

INSERT, UPDATE, DELETE, indexes and real transactions run on a private copy of the database, so nothing you write can break it. Then we check the table, not just your syntax.

Try a transaction challenge
Query Dojo for iPhone

Keep your streak in your pocket.

The same challenges and belts, plus timed mock interviews, a readiness score and a daily reminder that keeps the streak going.

Get the iPhone app

Your first query is waiting.

Start with an easy one. It takes about a minute.