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.
The Process
How It Works
Become a data detective in three steps. No prior experience required.
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.
Query the Database
Write SQL in the browser. No setup needed. Get hints from Chief Fox when you get stuck.
Crack the Case
Use your results to name the suspect and close the case. Earn XP and level up your rank.
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.
Recruit
FIRST CASERookie
SELECT · WHERE · LOGICDetective
AGGREGATES · NULLS · CASTSenior
JOINS · SUBQUERIES · CTESChief
WINDOW FUNCTIONSConcepts 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.
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.
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
Which director has the highest average rating across their films?
Metro Crime
Which detective has the highest close rate on cases they led?
TechCart
Which acquisition channel generates the most revenue per customer?
Pokemon
Which primary type has the highest average base stat total?
Alex's Spotify Wrapped
Which artist gets skipped least often, even in shuffle mode?
NBA 2024-25
Which team has the biggest gap between home and away win percentage?
Steam Games
Do free games actually get better user reviews than paid ones?
Or bring your own CSVs
A Kaggle download, an open dataset, a spreadsheet you exported. Parsed by DuckDB in your browser and never uploaded to us.
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.
Then go and get the job
SQL interview practice for the interviews you are actually sitting. Data analyst interview questions tagged by company, and a map of the data roles worth aiming at.
Google
Meta
Amazon
Netflix
Airbnb
Spotify
Twitter
Snapchat
Robinhood
Lyft
Coinbase
Interview Prep
Questions modelled on the loops at Google, Meta, Amazon and Netflix. Each opens in a real editor with the schema and a target output, checks your answer, then reveals a worked solution and the insight most candidates miss.
Browse the interview questionsData Roles
Data Analyst, BI Analyst, Analytics Engineer, Data Scientist, Data Engineer and ML Engineer. Where each sits on the analyze-to-build spectrum, the skill mix each one needs, and the SQL each one actually writes.
Explore the data rolesTHE 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.
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.
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.
“Students strengthened their SQL skills through interactive challenges on QueryCase.”
Course instructor · CompTIA Data+ cohort, 2026
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.
