SQL LEARNING · CHEATSHEET + PLAYGROUND
60 TOPICS · 10 CHALLENGES · VISUAL GUIDE
SQL you run, not SQL you memorise.
Learn SQL in the browser: a sixty-topic cheatsheet, a playground with real SQLite compiled to WebAssembly and ten challenges that compare results, not text.
- cheatsheet topics
- 60
- validated challenges
- 10
- screens in the guide
- 3
- parts explained
- 11
What it is and what it is for
SQL Learning is an interactive guide to learn and practise SQL in the browser: a 60-topic cheat sheet, a global Ctrl+K search, a playground with real SQLite compiled to WebAssembly, 10 automatically validated challenges and a database schema explorer.
The cheat sheet mirrors the original structure in four families: query basics (6), filtering (16), functions (25, with aggregate, window, string, numeric and date functions) and tables (13). Every example can be sent to the playground in one click.
You practise on hospital_lab.db, a coherent fictitious database of 5 related tables (20 patients, 8 doctors, 5 departments, 25 admissions and 30 lab results). Challenges compare your query result with the solution’s by running both in SQLite, not the text, and progress is saved in the browser.
When to use it
Learning SQL from scratch
Go through the topics by family and run every example without installing any engine.
Preparing for an interview or exam
Solve the 10 challenges, from easy to hard, with JOIN, GROUP BY and window functions.
Looking up syntax quickly
Search GROUP BY, COUNT() or a keyword and jump to the topic with the keyboard.
How it works
Content from the original cheat sheet
tools/extract.mjs generates topics.json and search.json from the legacy/ HTML.
In-browser engine
lib/sqlEngine loads sql.js and builds the database from dbSeed; “reset db” restores it.
Result-based validation
Each challenge runs your query and the solution and compares the result sets; tools/test-db.mjs checks in CI that every solution works.
What changes on pwn3d.es
- On pwn3d.es the tool is explained with a visual guide: its interface recreated in CSS, screen by screen, with each part numbered and explained.
- pwn3d.es neither runs nor hosts the tool: to use it there are its official site and repository, always at their latest version.
Installation and usage
Installation
git clone https://github.com/D1se0/sql-learning.git
cd sql-learning/website
npm install
npm run dev # http://localhost:5173Usage
npm run build # tsc --noEmit + vite build → dist/
npm run previewcd tools && node extract.mjs && node test-db.mjsReal examples
doctors (8) ──┐ departments (5) ──┼── admissions (25) ──> patients (20) <── lab_results (30)
Stack and dependencies
- React18
- UI with Vite 5 and strict TypeScript
- sql.js
- SQLite compiled to WASM, 100 % in the browser
- Tailwind CSS3
- Dark theme with the v1 red
- framer-motion
- Palette, accordion and reveal animations
- i18n propio
- UI and content in ES, EN, FR, DE and PT; SQL is never translated
git · repository code
Explore the repository
Related tools
Cheatsheet, challenges and schema adapted from sql-learning, released under the MIT licence. This integration uses sql.js 1.17.0, a new interface and our own validation engine; SQL stays as language and is not translated.