queryscratch
500 challenges · beginner → expert

Master SQL by solving,
not reading.

500 hand-crafted challenges from your first SELECT to recursive CTEs. Run real queries in the browser and get instant, exact-output feedback.

Press ⌘ K to search anything
top_earning_departments.sql
1
2
3
4
5
6
SELECT d.name AS department,
       SUM(e.salary) AS total_spend
FROM employees e
JOIN departments d ON d.id = e.dept_id
GROUP BY d.name HAVING SUM(e.salary) > 250000
ORDER BY total_spend DESC;
Output5 rows · 12 ms · matches
departmenttotal_spend
Engineering920,000
Sales540,000
Marketing410,000
Product360,000
Design285,000

The fastest way to interview-ready SQL

VercelLinearSupabaseStripeNotionDatadogVercelLinearSupabaseStripeNotionDatadog

Live SQL sandbox

A real SQLite engine runs in your browser. No setup, no server round-trips.

Beginner → expert tracks

500 questions organised into five finishable tracks with progress tracking.

Exact-output checking

Your result set is diffed against the expected output — pass means pass.

Keyboard-first

⌘K to jump anywhere, ⌘↵ to run. Built for people who live in their editor.

0
SQL challenges
0
difficulty tiers
0
topics covered
0%
in-browser

Ready to write better SQL?

Start with Foundations and work your way to expert-level recursive queries.