A hands-on PostgreSQL learning library — install it, learn psql, master tables, queries, joins, and aggregations, then level up to views, functions, indexes, and performance tuning. Every lesson is runnable SQL.
9 tutorials · beginner → advanced
Showing 9 tutorials
Get PostgreSQL 16 running on any machine: Homebrew, the Windows installer, apt, or a one-line Docker container — then make your first connection.
Connect with psql and move around like a pro: \l, \c, \dt, \d, \x, running .sql files, and the meta-commands you will use every day.
CREATE DATABASE, CREATE TABLE, primary and foreign keys, NOT NULL, UNIQUE, CHECK, DEFAULT — plus ALTER and DROP to evolve your schema safely.
TEXT vs VARCHAR, INTEGER vs NUMERIC, TIMESTAMPTZ, BOOLEAN, UUID, arrays, and a first look at JSONB — with the rules for picking the right type.
Write data with multi-row INSERT and RETURNING, update and delete with confidence (always WHERE first!), and meet upsert with ON CONFLICT.
The query skills you use every single day: filtering with WHERE, pattern matching with LIKE/ILIKE, sorting, pagination, DISTINCT, and NULL gotchas.
Combine tables the right way: how each join type answers a different question, visual row-matching mental models, and multi-table join patterns.
Turn rows into answers: COUNT, SUM, AVG, MIN, MAX, grouping by one or more columns, HAVING vs WHERE, and FILTER for conditional counts.
The whole database in one page: psql commands, DDL, CRUD, joins, aggregations, indexes, and admin snippets to copy-paste.