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.
Four things this game does differently from a typical SQL tutorial.
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.
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.
No account, no sign-up, no server. The database and your saved progress both live entirely in your browser’s local storage.
A three-tier hint system (a nudge, a query template, then the full solution) means you’re never permanently blocked on a puzzle.
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.
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.
Yes — the full curriculum, all 9 chapters, is free with no account, sign-up, paywall, or time limit.
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.
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.
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.
No. The first chapter starts from a completely blank SELECT statement and explains every concept before you’re asked to use it.
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.
Yes, the whole game — including the SQL editor and results view — is fully responsive down to small phone screens.
There are 27 puzzles across 9 chapters. It's entirely self-paced with no time limit — most players finish in a few focused sessions.