Learn SQL

Quick reference and in-depth lessons to sharpen your SQL skills.

beginner5
intermediate9
advanced7
·21 lessons total

You'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.

Every lesson, one page each

In curriculum order, from your first SELECT to higher-ed analytics.

  1. 1SELECT, WHERE & ORDER BY — The Foundation (Beginner)
  2. 2JOINs Deep Dive (Beginner)
  3. 3NULL Handling — COALESCE, NULLIF & IS NULL (Beginner)
  4. 4String Functions (Beginner)
  5. 5Data Types & Casting in PostgreSQL (Beginner)
  6. 6GROUP BY & HAVING — Advanced Aggregation (Intermediate)
  7. 7CASE — Conditional Logic Inside SQL (Intermediate)
  8. 8Common Table Expressions (CTEs) (Intermediate)
  9. 9Subqueries & Correlated Subqueries (Intermediate)
  10. 10Set Operations — UNION, INTERSECT, EXCEPT (Intermediate)
  11. 11Date & Time Functions (Intermediate)
  12. 12Arrays, STRING_AGG & JSON — Many Rows into One Cell (Intermediate)
  13. 13DISTINCT ON & LATERAL — Latest Row per Group, Top-N per Group (Intermediate)
  14. 14Window Functions (Advanced)
  15. 15Window Frames & FILTER — Running Totals, Moving Averages, Conditional Counts (Intermediate)
  16. 16EXPLAIN & Query Performance (Advanced)
  17. 17Indexes, Views & Materialized Views (Advanced)
  18. 18GROUPING SETS, ROLLUP & CUBE — Subtotals in One Pass (Advanced)
  19. 19Percentiles & Statistical Aggregates — Medians, Spread, Correlation (Advanced)
  20. 20Calendar & Gap Logic — Term Order, GENERATE_SERIES, Stop-outs (Advanced)
  21. 21The Higher-Ed Analyst Track — Census, FTE, Retention, Funnel, Financial Impact (Advanced)