← Back to the case

About The Query Files

The Query Files is a free, narrative SQL tutorial built as a detective game. You play the new data analyst on the Rosewood P.D. major crimes unit, investigating a stolen painting — and every clue comes from writing a real SQL query against a real embedded SQLite database, running entirely in your browser.

There's no account, no install, and nothing sent to a server: the database and your progress both live in your browser. You start from a blank SELECT and, by the end of the case, you're writing joins, subqueries, CTEs, CASE WHEN logic, and window functions well enough to actually name the criminal yourself, from the data.

Why it works

Four things this game does differently from a typical SQL tutorial.

🗄️

A real database, not a quiz

Every puzzle runs against a real embedded SQLite database (via sql.js/WebAssembly). Your query either returns the right rows or it doesn’t — no multiple choice.

🕵️

A real case, not a worksheet

Each SQL concept is introduced exactly when the story needs it, so JOIN, subqueries, and window functions all have a reason to exist instead of being isolated exercises.

🔒

Nothing leaves your browser

No account, no sign-up, no server. The database and your saved progress both live entirely in your browser’s local storage.

💡

Stuck? There’s a way out

A three-tier hint system (a nudge, a query template, then the full solution) means you’re never permanently blocked on a puzzle.

What you'll learn

The complete curriculum — 27 puzzles across 9 chapters, from your very first SELECT to window functions. Each chapter only ever needs what you've already learned.

0
Chapter 0Your first shift
SELECT & choosing columns
1
Chapter 1Narrowing the list
WHERE, AND/OR, LIKE, BETWEEN
2
Chapter 2Sorting the evidence
ORDER BY, LIMIT, DISTINCT, COUNT, GROUP BY, HAVING
3
Chapter 3Cross-referencing files
INNER JOIN — matching suspects to alibi records
4
Chapter 4The missing alibi
LEFT JOIN + IS NULL, self JOIN for accomplice pairs
5
Chapter 5Reading between the lines
Subqueries and WITH (CTEs)
6
Chapter 6Patterns & timing
CASE WHEN, string & date functions, building a timeline
7
Chapter 7Ranking the leads
Window functions — RANK() OVER, PARTITION BY
8
Chapter 8The case file
Finale — one query, multiple joins & CTEs, name the criminal

Who it's for

Complete beginners who've never written a query, students studying for a class or interview, and anyone who's watched SQL tutorial videos before but never gotten real, graded practice writing queries against a real database and seeing exactly why an answer is right or wrong.

Frequently asked questions

Is The Query Files actually free?

Yes — the full curriculum, all 9 chapters, is free with no account, sign-up, paywall, or time limit.

Do I need to install anything?

No. It runs entirely in your browser using SQLite compiled to WebAssembly (sql.js) — there’s nothing to download or configure beyond loading the page.

Is my progress saved anywhere?

Yes, automatically, in your browser’s own local storage — not on a server. Close the tab or come back tomorrow and you resume exactly where you left off. Nothing is uploaded anywhere.

What SQL dialect does it use?

SQLite syntax, via sql.js. Nearly everything you learn (SELECT, WHERE, JOIN, GROUP BY, subqueries, CTEs, CASE WHEN, window functions) transfers directly to PostgreSQL, MySQL, and other SQL databases.

Do I need any prior programming experience?

No. The first chapter starts from a completely blank SELECT statement and explains every concept before you’re asked to use it.

What if I get stuck on a puzzle?

Open the hint panel: a free conceptual nudge, then (for a small in-game cost) a query template, then the full solution — so you can get unstuck without losing the challenge entirely.

Does it work on mobile?

Yes, the whole game — including the SQL editor and results view — is fully responsive down to small phone screens.

How long does it take to finish?

There are 27 puzzles across 9 chapters. It's entirely self-paced with no time limit — most players finish in a few focused sessions.

RUNS ENTIRELY IN YOUR BROWSER · REAL EMBEDDED SQLITE · NO ACCOUNT, NO SERVER