← All courses

Free · beginner to interview level · no sign-in

SQL, played

A public library, an online retailer, a company HR office, a learning platform, a logistics firm: nine modules, one way of learning. Read a short case, see the idea with example queries, watch a lab act it out row by row, then write real SQL against a real database in your browser. Your query is run and compared with the expected result, so every answer is checked the moment you submit it.

For anyone: BBA, MBA, B.Tech, BA, B.Sc. and M.Sc. students, people preparing for data and analyst interviews, and working professionals brushing up. No installation. The game runs SQLite; wherever MySQL would need different syntax, a gold box says so. Modules build on each other, so start at 0 unless you already know the earlier material. Progress is saved in your browser only.

The nine modules

Your desk

Read from this browser's saved progress.

How it works

One story per module

A library moving off paper, an online retailer's analytics desk, an HR audit cell, a learning platform's build room, a logistics control tower, a data warehouse. Each case file is a request someone there actually makes, and SQL is how you answer it.

A real SQL engine

Every query runs in SQLite inside your browser, on databases with thousands of rows. Nothing is sent anywhere. Break a table, and Reset brings it back.

MySQL alongside

Most courses and jobs use MySQL. Wherever MySQL needs different syntax (dates, IF, AUTO_INCREMENT, ROLLUP, procedures, users), the page tells you what you would write there.

Labs that move

Clauses run in their logical order, rows of two tables find their partners, groups fill into buckets, a window slides along a partition, an index lookup races a full scan, a transaction rolls back.

Interview classics

Second-highest salary, customers with no orders, top three per group, running totals, duplicates, managers and their reports, streaks and cohorts: each module includes the questions interviewers ask.

Challenges and XP

First-try answers earn 100 XP, hints cost 25, each cleared file earns a badge, and five cleared files unlock the board meeting. Bring your own CSV into the sandbox to practise on your own data.

SQL, played · built by Aritra Pan. Free to use in teaching; a link back is appreciated. All organisations and people in the modules are fictional. The databases were generated for teaching. The in-browser engine is SQLite, compiled to WebAssembly (sql.js, MIT licence).