Learn SQL
Quick reference and in-depth lessons to sharpen your SQL skills.
beginner5
intermediate9
advanced7
·21 lessons totalYou're learning PostgreSQL
All queries run on real PostgreSQL — the world's most advanced open-source relational database. Syntax like FILTER (WHERE …), ::cast, and NULLIF() are all fair game.
Beginner
Intermediate
Advanced
Every lesson, one page each
In curriculum order, from your first SELECT to higher-ed analytics.
- 1SELECT, WHERE & ORDER BY — The Foundation (Beginner)
- 2JOINs Deep Dive (Beginner)
- 3NULL Handling — COALESCE, NULLIF & IS NULL (Beginner)
- 4String Functions (Beginner)
- 5Data Types & Casting in PostgreSQL (Beginner)
- 6GROUP BY & HAVING — Advanced Aggregation (Intermediate)
- 7CASE — Conditional Logic Inside SQL (Intermediate)
- 8Common Table Expressions (CTEs) (Intermediate)
- 9Subqueries & Correlated Subqueries (Intermediate)
- 10Set Operations — UNION, INTERSECT, EXCEPT (Intermediate)
- 11Date & Time Functions (Intermediate)
- 12Arrays, STRING_AGG & JSON — Many Rows into One Cell (Intermediate)
- 13DISTINCT ON & LATERAL — Latest Row per Group, Top-N per Group (Intermediate)
- 14Window Functions (Advanced)
- 15Window Frames & FILTER — Running Totals, Moving Averages, Conditional Counts (Intermediate)
- 16EXPLAIN & Query Performance (Advanced)
- 17Indexes, Views & Materialized Views (Advanced)
- 18GROUPING SETS, ROLLUP & CUBE — Subtotals in One Pass (Advanced)
- 19Percentiles & Statistical Aggregates — Medians, Spread, Correlation (Advanced)
- 20Calendar & Gap Logic — Term Order, GENERATE_SERIES, Stop-outs (Advanced)
- 21The Higher-Ed Analyst Track — Census, FTE, Retention, Funnel, Financial Impact (Advanced)