SQL Detective

Learn SQL by solving mysteries

7 cases. Each has its own records. Read them with real SQL.

Start with any case.

About SQL Detective

SQL Detective teaches SQL through seven mysteries. Each case has its own tables of records. You write real SQL queries to find clues. The last chapter of each case names the culprit. Case 1 is for people who have never written SQL.

How to play

  1. Choose a case. All seven are open, and each says what to know first.
  2. Read the two-line lesson and tap Try it to run the example.
  3. Write your query in the editor and press Run. You always see the result table.
  4. A wrong answer gets a plain hint, and a mistake gets a clear error message.
  5. A right answer gives you the next clue. Solve every chapter to name the culprit.

What it practises

The game has 73 chapters. They start with SELECT, WHERE, ORDER BY and COUNT. Later ones cover GROUP BY, HAVING, JOIN, LEFT JOIN, subqueries and CASE WHEN. Case 7 uses window functions like RANK and LAG. Your queries run on real SQLite inside your browser tab.

Questions

How do I learn SQL for free?
Play Case 1. It teaches SELECT, WHERE and COUNT with a short lesson in every chapter. You write real queries, and it's free.
Do I need to install anything to practise SQL?
No. The database runs inside your browser tab. Nothing is saved on a server, and a reload rebuilds it.
Can beginners play SQL Detective?
Yes. Case 1 assumes you know nothing. Hints climb from a reminder to a query with blanks, and they're never punished.

You might also like