GN Math logoGN Math
SQL Detective Mystery

SQL Detective Mystery

SQL Detective Mystery is a crime case you can only crack by querying a database. A murder took place in SQL City, and the date on record is January 15, 2018. Every other fact is hidden in tables of reports, interviews and records.

The database runs inside the page itself, so nothing gets installed and it works in a regular browser on a school laptop. It suits anyone who knows a little SQL or wants a reason to learn.

How to play SQL Detective Mystery

The page is made of code boxes. Each holds a starting query you can edit, and pressing Run shows the results as a table right below. The opening boxes demonstrate two basics: seeing which tables exist and seeing what columns a table holds.

Begin with the crime scene report for that date and city. It names witnesses, and you can look them up in other tables to read what they said. Their statements lead to more records you can match up, piece by piece.

When you have a suspect, enter the name in the solution check box and run it. A wrong guess gets a gentle no. A correct name unlocks a second, tougher question about who was really behind it. A separate walkthrough page teaches the basics for beginners.

Controls

ActionKeyboardMouseTouch
Write or edit a queryType in a code boxClick a code boxTap a code box
Run the queryShift + EnterRun buttonRun button
Restore the starting query—Reset buttonReset button
View the database diagram—Click the diagram linkTap the diagram link

Tips

  • Open the schema diagram before anything else. It shows which ID columns connect one table to another.
  • Narrow results with WHERE on date, type and city right away, or you will scroll through a long list of reports.
  • Witnesses may be described only partly. LIKE with % wildcards finds a name or street when you only know a piece of it.
  • To find the biggest or last value in a column, sort it in descending order and keep only the top row.
  • Keep notes in a separate tab or on paper. Names, IDs and dates scroll away fast and the page does not save them.

If you like SQL Detective Mystery, try these

  • CSS Diner

    Typing real code to select the right things links these, using CSS selectors on plates of food.

  • Learn Git Branching

    Real commands typed into a puzzle drive this too, with git reshaping an animated commit tree.

Questions

Do I need to know SQL to play SQL Detective Mystery?

Basic SELECT, WHERE and JOIN knowledge helps a lot. If you are brand new, start with the walkthrough page, which explains each step with examples you can run.

Does SQL Detective Mystery work on a phone?

It loads and runs, but typing queries on a small touch keyboard is slow. A laptop or Chromebook with a real keyboard is much more comfortable.

Is my progress saved?

No. The page does not remember your queries or notes, so a reload resets the boxes. Copy anything important before you leave.

More like this: all puzzle games · every game A–Z

More puzzle games

See all →
Elevator Saga game screenElevator SagaPuzzleFlexbox Lily Pond game screenFlexbox Lily PondPuzzleLearn Git Branching game screenLearn Git BranchingPuzzleRobot Coder game screenRobot CoderPuzzle2048 game screen2048PuzzleMahjong Solitaire game screenMahjong SolitairePuzzleWord Search game screenWord SearchPuzzleBlack Box Lasers game screenBlack Box LasersPuzzleBlack Hole Square game screenBlack Hole SquarePuzzleBlock Drop game screenBlock DropPuzzle