Library

SQL & Postgres, Step by Step — the course on one page

What this is: a complete 5-stage path from "what is a database" to production PostgreSQL — 18 parts, four stage projects, and four pick-one career tracks — taught against one small store database (shopdb) whose nine tables every lesson shares (Stage 4 adds million-row lab tables where size is the lesson). Every printed output comes from a real run on PostgreSQL 17 — tools/capture.py re-executes them all against a live server, so the lessons cannot drift from reality.

The path:

Stage Weeks You come out able to Status
1 · Foundation 1–2 Install and drive psql, query one table precisely, choose types, tame NULL, and summarise with GROUP BY/HAVING/FILTER ✅ Ready
2 · Intermediate 3–4 Join any number of tables, structure hard questions with CTEs, and write window-function analytics ✅ Ready
3 · Advanced 5–6 Design normalised schemas with constraints, write data safely at scale, reason about transactions, use JSONB and search ✅ Ready
4 · Performance & internals 7–8 Read EXPLAIN, design indexes, and fix slow queries with a method ✅ Ready
5 · Specialization 9–10 One career track deep, with a portfolio capstone ✅ Ready

The method, in one paragraph: every part is a numbered lesson you run, not read — psql open beside it, predicting each result before Enter. Examples ship as \i-runnable files; exercises come before solutions, and the solutions explain why. Each stage ends in a project with acceptance checks, so "done" is measurable. shopdb resets with one command, so no mistake is ever expensive.

Suggested pace: 30–60 minutes a day. Rushing SQL is how people end up knowing the words but not the music — the exercises are the course.

Search the guide