Interactive · runs in your browser
Databases, from scratch.
Start with why a database even exists, see the different kinds and when to use each, then learn SQL by writing it. Every lesson has a real Postgres database running right in this page — type a query, hit run, see the rows. No install, no signup, no setup.
Start here
- Foundationseasy9 min
Why a Database, Really?
Before any SQL, the question nobody answers simply: why not just save data in a file or a spreadsheet? What a database actually gives you that a file can't, explained from scratch with no jargon.
- Foundationseasy14 min
The Types of Databases (and the Popular Names)
Relational, document, key-value, wide-column, graph, search, time-series, vector — the kinds of databases explained simply, each with what it's shaped for, when to use it, and the popular products in each family.
Hands-on SQL
- SQLeasy12 min
Your First Queries: SELECT, WHERE, ORDER BY
Read data out of a database with SQL. SELECT to choose columns, WHERE to filter rows, ORDER BY to sort, LIMIT to cut it short — practised live against a real Postgres running in your browser.
- SQLmedium13 min
Connecting Tables with JOIN
Data is split across tables on purpose. JOIN puts it back together. Inner joins, the join condition, multi-table joins, and LEFT JOIN for 'include the ones with nothing' — practised live in a real Postgres.
- SQLmedium13 min
Summarising Data: COUNT, SUM, GROUP BY
Turn rows into answers. Aggregate functions (COUNT, SUM, AVG, MIN, MAX), GROUP BY to summarise per category, and HAVING to filter the groups — all practised live against real Postgres.
- SQLmedium12 min
Changing Data: INSERT, UPDATE, DELETE
Reading is half the job. Add rows with INSERT, change them with UPDATE, remove them with DELETE — and learn why the WHERE clause is the most important (and most dangerous) word when you're writing, plus how foreign keys protect you.
- SQLmedium14 min
Making Queries Fast: Indexes and EXPLAIN
Why the same query can be instant or painfully slow, what an index really is, and how to ask Postgres exactly how it ran your query — with EXPLAIN ANALYZE, live in your browser.
Advanced SQL
- SQLhard14 min
Subqueries and CTEs: Queries Inside Queries
When one query needs the answer to another query first. Subqueries in WHERE and SELECT, correlated subqueries, CTEs with WITH for readable multi-step logic, and recursive CTEs for trees and series — all live in real Postgres.
- SQLhard16 min
Window Functions: Rankings and Running Totals
The advanced SQL feature interviewers love and beginners rarely meet. Compute rankings, running totals, per-group numbering, and row-to-row comparisons — all while keeping every individual row. RANK, SUM OVER, PARTITION BY, and LAG, live in real Postgres.
The popular databases
- PostgreSQLeasy11 min
PostgreSQL: The Default You Should Reach For
Why Postgres is the database most teams should start with and rarely outgrow. The relational core you already know, plus JSON, full-text search, and vectors in one system — with the features that make it special and when not to use it.
- MySQLeasy9 min
MySQL: The Other Giant
The database behind a huge slice of the web. How MySQL compares to Postgres, where it shines, the InnoDB engine, and the dialect differences to watch for when your SQL knowledge moves over.
- SQLiteeasy9 min
SQLite: The Database That's Just a File
The most widely deployed database on earth runs inside your phone, your browser, and probably this page. Why a serverless, single-file database is perfect for some jobs and wrong for others.
- MongoDBeasy10 min
MongoDB: Documents Instead of Tables
The most popular document database. How storing flexible JSON documents differs from rows and tables, what that buys you, what it costs, and the honest take on when a document model actually fits.
- Rediseasy10 min
Redis: The In-Memory Swiss Army Knife
Not a database you store everything in — a blazing-fast in-memory store you reach for to make the rest of your system fast. Caching, sessions, rate limits, queues, and leaderboards, with the data structures that power each.
- Foundationseasy12 min
The Rest of the Field, in Brief
Cassandra, DynamoDB, Elasticsearch, Neo4j, ClickHouse, DuckDB, time-series stores, and the vector databases: a quick, honest tour of the specialised databases so you recognise each name and know the one job it's built for.