Learn SQL in a detective game

A real course behind the story: solve SQL case files against a real database, from your first SELECT all the way to window functions. No prior experience needed.

2,500+ detectives117 countries17,800+ solved

The Process

How It Works

Become a data detective in three steps. No prior experience required.

1
?

Open your first case

Cases run in order across four ranks. Each hands you a briefing, a real database and a mystery, and closing it unlocks the next.

2

Query the Database

Write SQL in the browser. No setup needed. Get hints from Chief Fox when you get stuck.

3

Crack the Case

Use your results to name the suspect and close the case. Earn XP and level up your rank.

THE SQL LADDER

54 cases. Four ranks.
One detective: you.

A complete path from your first WHERE clause to window functions, told as one career on the force. Drills sharpen each skill, exams earn your promotions, and every rank comes with a certificate.

54CASES
12DRILLS
4EXAMS
4CERTIFICATES

Recruit

FIRST CASE

Rookie

SELECT · WHERE · LOGIC

Detective

AGGREGATES · NULLS · CAST

Senior

JOINS · SUBQUERIES · CTES

Chief

WINDOW FUNCTIONS

Concepts when the story needs them

JOINs show up when suspects and alibis stop matching. Nothing is taught in a vacuum.

Exams that mean something

Pass the level exam to earn your promotion and a shareable certificate for each rank.

Streaks and a global leaderboard

Daily streaks, XP rankings, public detective profiles. Friendly pressure included.

SQL INVESTIGATIONS

Then prove it for real

Guided cases teach you. Investigations test you. A full mystery across six tables, three acts, and a ticking clock. When you think you have it, you make one accusation.

  • No hints, no training wheels. Just you, the schema, and the evidence.
  • Real multi-table schemas. Staff records, sensor logs, shipping manifests, phone records.
  • One accusation. Name the perpetrator and their role. Get it wrong, live with it.
THE LOUVRE AFFAIR
● ACT 1ACT 2ACT 3
00:15MAKE ACCUSATION
QUESTION 1 OF 6 · THE WRONG THEORY

The museum's sensor network flagged an anomaly on the night of November 28th. Which gallery room did it occur in?

Type your answer and press Confirm
TABLES ON FILE
  • staff
  • badge_events
  • sensor_logs
  • artwork_registry
  • shipping_manifests
  • communication_records
THE SQL SANDBOX

Off duty? Query anything.

7 real datasets, 44 tables, no objectives and no hints. Or drop in your own CSVs and query those instead. The fastest way to make SQL stick is asking your own questions about data you actually care about.

IMDb Ratings

7 TABLES · 6,203 ROWS

Which director has the highest average rating across their films?

Metro Crime

7 TABLES · 2,239 ROWS

Which detective has the highest close rate on cases they led?

TechCart

5 TABLES · 5,595 ROWS

Which acquisition channel generates the most revenue per customer?

Pokemon

8 TABLES · 12,015 ROWS

Which primary type has the highest average base stat total?

Alex's Spotify Wrapped

6 TABLES · 11,033 ROWS

Which artist gets skipped least often, even in shuffle mode?

NBA 2024-25

4 TABLES · 1,198 ROWS

Which team has the biggest gap between home and away win percentage?

Steam Games

7 TABLES · 8,855 ROWS

Do free games actually get better user reviews than paid ones?

Or bring your own CSVs

UP TO 5 FILES · JOIN THEM

A Kaggle download, an open dataset, a spreadsheet you exported. Parsed by DuckDB in your browser and never uploaded to us.

And then

See the answer, not just the rows.

Any query you run can become a chart without leaving the page. Put a column on each axis, pick how to add it up, and take the picture away as a PNG.

The SQL it wrote stays on screen underneath. Dropping a field on an axis and choosing an aggregate writes a GROUP BY, so the chart is the reward and the query below it is the thing you are actually learning.

ResultsChart
Films per decade0204060Count of films161950s141960s171970s261980s371990s432000s512010s282020sdecade
Xdecade
YCount of films
CHARTBar

THE PEOPLE BEHIND THE PROGRESS

Learning that clicks.

From a first SQL query to the final case.

I know basic SQL and honestly I did not understand window functions and some advanced concepts until I started querying in QueryCase. You have put all the concepts up in a structured manner.
Data engineerFinished all 54 cases
This is my first approach to SQL in my life, and it is very intuitive. I finished the free cases already, and I was surprised when I looked at the price and saw it was one payment.
New to SQLvia Reddit
I am a second year data science student and it would have been great to have this in my relational database management systems unit. This website makes it feel easy, and most importantly, engaging.
Data science studentvia Reddit
Used in a US college labWeekend lab · 4 hours of practice

“Students strengthened their SQL skills through interactive challenges on QueryCase.”

Course instructor · CompTIA Data+ cohort, 2026

COMMON QUESTIONS

What people ask before they start.

Whether this is a game or a course, what it teaches, and where it stops.

Yes, and it is a course at the same time. You play a detective solving cases, and every case is solved by writing real SQL against a real database running in your browser. The difference from most SQL games is that it does not stop after one story: there are 54 guided cases, 12 drills and 4 rank exams, arranged so each rank teaches a band of SQL and the next one builds on it.

A SQL detective game gives you a crime and a database instead of an exercise and an answer box. Nobody tells you which tables matter, so the query is how you investigate: you filter, join and group your way to the person who did it. QueryCase is built this way throughout, and the detective framing is the curriculum rather than decoration, because each rank is a harder class of question rather than a new story.

A case file is one self-contained SQL mystery: a briefing, a set of tables and a question you answer by querying them. QueryCase has 54 of them. Each is broken into steps, each step checks your query against the real result rather than against a string of expected text, and the case closes when the evidence actually supports the conclusion. They are the unit the whole course is built from.

You can, on one condition: the game has to run real SQL against a real database, so a wrong query fails the way it fails at work. A quiz about SQL teaches you trivia about SQL. QueryCase executes everything you write, which is why it can take you past the point most games stop at: aggregates and GROUP BY, HAVING, NULL handling, CASE expressions, subqueries, CTEs and window functions.

Not a released one that teaches SQL, which is why a lot of these searches end up here. QueryCase is browser based rather than a download: there is nothing to install, no database to set up, and your progress is saved to your account instead of a save file. If you were looking for something to play on a console or a storefront, this is not that, but it is the closest thing to a real SQL game with a course behind it.

The first cases in each rank are free and need no payment to play. Pro is a single payment of 14.99 pounds, and it unlocks every case, drill and rank exam, the investigations, the sandbox and the interview prep, permanently. It is not a subscription, so there is nothing to cancel and no monthly bill.

It starts at SELECT and WHERE and finishes at window functions. In between: ORDER BY and LIMIT, the aggregates with GROUP BY and HAVING, DISTINCT, NULL handling with COALESCE, string and date functions, CAST, CASE expressions, subqueries including EXISTS, inner and left and anti joins, UNION and INTERSECT and EXCEPT, CTEs, and ROW_NUMBER, RANK, DENSE_RANK, SUM OVER, LAG and LEAD with PARTITION BY.

No. The database runs inside your browser tab, so there is no server to connect to, no Postgres to install and nothing to configure. You write a query, it executes against real tables, and you see real rows back. It works on a laptop you do not have admin rights on, which is the usual reason people never get started.

Yes. The first rank assumes you have never written a query and teaches SELECT and WHERE from nothing, with each case introducing one idea at a time. What makes it work for beginners is that you are never staring at a blank editor wondering what to try: the case tells you what you are looking for, and the SQL is the tool you reach for to find it.

The SQL Murder Mystery is one excellent puzzle that takes about an hour and then ends, and it assumes you already know SELECT, WHERE and JOIN before you start. QueryCase picks up at roughly that difficulty and keeps going for 54 cases, so the things that puzzle never reaches, GROUP BY and HAVING, CTEs, window functions and the order SQL actually runs in, are taught rather than assumed.

About twenty hours of actual querying across the four detective ranks, though almost nobody does it in one run. Cases take five to fifteen minutes each, which is deliberate: it is designed to survive being picked up for twenty minutes after work. The drills exist so that what you learned three weeks ago is still there when a later case needs it.

That is what the interview prep is for. It holds company-style SQL questions modelled on the loops at firms like Netflix, Spotify and Coinbase, each solvable in a browser editor with a worked solution and the reasoning behind it. The cases build the fluency; the interview questions rehearse the specific shapes that come up when somebody is watching you type.

54
Cases to Solve
100%
Free to Start
5
Ranks, Rookie to Chief
Zero
Setup. Runs in your browser.

YOUR FIRST CASE IS WAITING

Your first case.
Your next skill.

The SQL game that is a full SQL course underneath. Start with a free case and you will be writing queries in minutes.

No experience neededNo credit card required