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
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
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.
- 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.
- 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.
- 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;
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.
- White Start
- Yellow 100 pts
- Orange 300 pts
- Green 700 pts
- Blue 1,400 pts
- 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
One challenge a day adds up.
A new free challenge every day, the same one for everybody. Solve it for a bonus and keep your streak alive.
Train by topic
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; COMMIT and everything rolls back 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.
Four databases. 29 tables.
Realistic schemas with the joins, NULLs and edge cases you'll meet at work and in interviews.
E-commerce
Customers, orders, products and line items from an online store, plus scenario tables.
Employees
An org chart: people, departments, salaries and who reports to whom.
School
Students, courses and enrollments with grades and GPAs.
Music
Artists, albums and tracks with release years and durations.
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 appYour first query is waiting.
Start with an easy one. It takes about a minute.