PostgreSQL Fundamentals
Learn how PostgreSQL stores and retrieves data: how tables and constraints model facts, how SELECT slices them, how joins relate them, and why indexes and transactions matter. Each lesson pairs real SQL to read with a runnable challenge that models the underlying idea in plain JavaScript.
5 lessons · ~2 hours
1. SQL, Refreshed
Tables, types & constraints
A table is a typed set of rows, and constraints are rules the database refuses to break.
Querying: SELECT, WHERE, ORDER, LIMIT
A SELECT picks columns, filters rows, sorts them, then cuts the list — in that order.
Joins
A join stitches rows from two tables together wherever a key matches.
Indexes & EXPLAIN
An index trades disk space for speed by letting Postgres jump straight to rows instead of scanning them all.
Transactions & ACID
A transaction groups writes so they all commit together or all roll back as if nothing happened.