SQL and Relational Database Engineering
Use PostgreSQL to turn a shop ledger into a reliable database and explain its behavior under load.
Beginner
Model a Shop with Tables and Keys
Choose rows, types, primary keys and foreign keys for customers, orders and line items.
Upcoming lessonAnswer Questions with SELECT
Filter, sort and group sales while accounting for nulls, duplicate values and empty results.
Upcoming lessonJoin Tables Without Counting Twice
Predict the row count of inner and outer joins and fix a revenue report inflated by a one-to-many join.
Upcoming lesson
Intermediate
Turn Business Rules into Constraints
Normalize a price list and make the database reject invalid keys, quantities and duplicate business records.
Upcoming lessonCommit a Transfer Atomically
Implement the two entries of a transfer and test the effect of rollback after the first write.
Upcoming lessonUse Windows to Explain Customer Behavior
Build a running total and rank purchases per customer while preserving the detail rows.
Upcoming lesson
Advanced
Design an Index for a Real Query
Choose composite key order for a filtered, sorted list and measure the extra write cost.
Upcoming lessonRead a PostgreSQL Query Plan
Compare estimated and actual rows in EXPLAIN ANALYZE to distinguish a bad estimate from expensive I/O.
Upcoming lessonChoose an Isolation Level
Run two concurrent reservations, observe a write anomaly and decide when a serializable retry is worth its cost.
Upcoming lesson
Expert
Migrate a Busy Table Online
Add and backfill a column in batches, validate it and retire the old representation across application releases.
Upcoming lessonProve Point-in-Time Recovery
Restore a shop database into an isolated environment and measure the recovery time and last intact transaction.
Upcoming lessonCapstone — Audit a Ledger Under Load
Validate ledger totals under concurrent writes, interpret query plans and demonstrate recovery from a mistaken change.
Upcoming lesson