// 2026-07-28 · Learning & Education · by Bob Smith

SQL Murder Mystery: Learn SQL by Solving a Crime

SQL Murder Mystery drops you in SQL City with a database and a body. Query your way to the killer, free, in-browser, no setup, and genuinely fun.

Screenshot of SQL Murder Mystery
SQL Murder Mystery: what you'll see when you land there

SQL Murder Mystery is a free browser game where the only way to catch a killer is to write SQL queries. There’s been a murder in SQL City on January 15, 2018, the detective handed you the crime scene report, and, awkwardly, you lost it. Everything you need is sitting in the police department’s database. Type queries, follow the trail, name your suspect. No install, no signup, no excuses.

What is the SQL Murder Mystery?

It’s the rarest thing in tech education: a tutorial that doesn’t feel like one. Instead of “here is the SELECT statement, now write ten of them,” you get a premise, a database, and a query box, and the syntax arrives exactly when you need it. Motivation does the teaching.

The setup is deliberately open. You know it was a murder, you know the date, you know the city. That’s it. Your first job isn’t even solving the crime, it’s finding the crime scene report, which means figuring out what tables exist and how they’re shaped. The site nudges you: the database is SQLite, and there are specific commands for listing tables and inspecting their structure. Learning to look around an unfamiliar database is, honestly, the most useful skill the whole thing teaches.

From there it’s a proper chain. A report points to witnesses. Witnesses point to a gym membership, a license plate, a check-in log. Every link is one join or one WHERE clause away, and every time it resolves you feel briefly like a genius. That feeling is the entire pedagogical engine.

What can you do on the site?

  • Run real SQL in the browser. Query boxes are embedded right in the page and execute against the actual mystery database: no server, no local setup, no Docker.
  • Take the walkthrough if you’re new. A guided path teaches the commands step by step while still letting you solve the case yourself.
  • Skip straight to the crime if you’re not. Experienced users get the premise and nothing else. Good luck.
  • Peek at the schema: but only if you want to. There’s a hidden schema diagram behind a click. Resisting it for as long as possible is half the game.
  • Check your solution. When you think you’ve got your killer, there’s a verification query that tells you whether you nailed it.
  • Keep going after the arrest. There’s a bonus challenge for anyone who finishes early and still wants to be smug about it.

Tips to get the most out of it

  1. Don’t open the schema diagram first. Inferring the structure with queries is the single most transferable skill here. You’ll do exactly this on your first day at a new job.
  2. Keep a scratch file. Paste every query that worked into a text editor as you go. When the trail forks, you’ll want to backtrack without rewriting everything.
  3. Use LIKE liberally. Witness statements are fuzzy and full of half-remembered details. Substring matching on text fields is your friend when you only have a fragment.
  4. Read the interview transcripts closely. The clues are written in plain English and they’re specific. Most people who get stuck are stuck because they skimmed a sentence, not because their SQL is wrong.
  5. Do it a second time as one query. Once you know the answer, try to chain the entire investigation into a single statement with joins and subqueries. That’s the real exercise, and it turns a fun hour into an actual lesson.

If you like SQL Murder Mystery, also try…

  • regex101: the other syntax everybody fakes until they don’t, with a live explainer that shows what each token matches.
  • The Evolution of Trust: a playable explainer that teaches game theory the same way this teaches SQL.
  • Monkeytype: because all this querying goes faster when your hands keep up with your brain.

The rest of the good stuff lives on the Learning & Education page. But go arrest somebody first: SQL Murder Mystery takes about an hour and you’ll remember JOIN forever.

Frequently asked questions

What is the SQL Murder Mystery?

SQL Murder Mystery is a free browser game that teaches SQL by making you solve a fictional homicide. A murder happened in SQL City on January 15, 2018, and the only way to identify the killer is to write queries against the police department's database. It works as both a self-guided lesson for beginners and a puzzle for experienced SQL users.

Is the SQL Murder Mystery free?

Yes, completely free with no signup. It runs entirely in your browser using SQL.js, so there is nothing to install and no database server to configure. The project's code is on GitHub under an MIT license and the text is Creative Commons licensed.

Do I need to know SQL already?

No. There is a built-in walkthrough that teaches SELECT, WHERE, JOIN, and the rest as you need them, so complete beginners can finish the case. If you already know SQL, you can skip the walkthrough and go straight to the crime scene report.

Who made the SQL Murder Mystery?

It was created by Joon Park and Cathy He while they were fellows at Northwestern University's Knight Lab, and adapted for the web by Joe Germuska. The browser-based SQL is powered by SQL.js, and the whole thing is open source.

Visit SQL Murder Mystery →

← All posts · Browse the directory