Visual guide
SQL Learning
How to study with SQL Learning: the 60-topic cheatsheet, the playground running real SQLite in the browser and challenges that compare results, not text.
- 60
- cheatsheet topics
- 10
- validated challenges
- 5
- related tables
- WASM
- SQLite in the browser
3 screens · 11 parts explained
The cheatsheet: from SELECT to window functions
Sixty topics in four families, each with an example ready to send to the playground in one click.
Families
- Basic queries6
- Filtering16
- Functions25
- Tables13
Search topic: JOIN, GROUP BY, ROW_NUMBER…
AggregationWindowTextNumericDates
Numbers rows within each partition by an order. Useful to keep “the first of each group”.
Example · Send to playground ▸sql
1SELECT first_name, specialty, salary, 2 ROW_NUMBER() OVER ( 3 PARTITION BY specialty 4 ORDER BY salary DESC) AS pos 5FROM doctors;
Four families
Basic queries, filtering, functions (aggregate, window, text, numeric and date) and tables, as in the original cheatsheet.
Global search
Ctrl+K searches the 60 topics; chips narrow by function type.
Short explanation
What the clause does and what it is used for in practice, in two lines.
Runnable example
It uses the practice database, so it can be sent to the playground to see the real result.
The playground: write SQL, see the result
SQLite compiled to WebAssembly runs inside your browser on hospital_lab.db. There is no server: nothing leaves your machine.
hospital_lab.db
- patients20
- doctors8
- departments5
- admissions25
- lab_results30
query · Ctrl+Entersql
1SELECT d.name, COUNT(*) AS ingresos 2FROM admissions a 3JOIN departments d USING (department_id) 4GROUP BY d.name 5ORDER BY ingresos DESC;
| name | ingresos |
|---|---|
| Cardiología | 7 |
| Urgencias | 6 |
| Neurología | 6 |
| Pediatría | 4 |
| Traumatología | 2 |
5 rows · 1.8 ms · SQLite 3.4x (WASM)
Schema at hand
The five tables with their row counts. One click shows columns, types and relations.
Editor
You write the query and run it with Ctrl+Enter.
Real result
The table SQLite returns, not a precomputed answer.
Status
Rows returned and timing. Errors show up here with SQLite’s message.
The challenges: ten goals with validation
Each challenge asks for a result. Your query and the solution both run and the rows are compared, so any correct SQL counts.
- 01 · Patients from Madrid✔
- 02 · Doctors per specialty✔
- 03 · Admissions not dischargedin progress
- 04 · Average glucose
- 05 · Top salary per floor
List patient name and admission date for those still admitted, oldest first.
WHERE discharge_date IS NULL ORDER BY admission_date
✔ 5 rows · match the solution
progress saved in this browser
Challenge list
Ten goals of increasing difficulty; progress is saved in the browser.
What is asked
The brief describes the expected result, not the query.
Result-based validation
The rows returned by your query and the solution are compared. If they match, it is right, however you wrote it.
How it is used
Check the cheatsheet
Find the topic and read the example.
Try it
Send it to the playground and tweak it.
Explore the schema
See how the tables relate to write your JOINs.
Solve challenges
Test what you learned with automatic validation.
Key concepts
- JOIN
- Combines rows of two tables through a shared column.
- GROUP BY
- Groups rows to compute totals, averages or counts per group.
- Window function
- Computes over related rows without collapsing them (rankings, running totals).
- WebAssembly
- A format that lets SQLite, written in C, run inside the browser.
Want to use it for real?
This guide explains each part of the interface. The full, always up-to-date tool lives on its official site and repository.