SQL for Nerds
summary
Shows how to solve Advent of Code puzzles using only PostgreSQL SQL (no PL/pgSQL). Describes loading raw inputs with psql \copy, making scripts idempotent via per-day schemas and DROP SCHEMA CASCADE, and implementing algorithms with generate_series, regexp_split_to_array, and recursive CTEs. Also covers using generated columns, PostGIS geometry types, partial and functional indexes, and VACUUM/ANALYZE to tune performance, with solutions ranging from 63 to 8 lines and some puzzles requiring extensive optimization time.
AI-written summary · about
chapters (4)
related talks
47mLearning advanced SQL the weird (and hard) way
34mSimple and Awesome Database Tricks
44mPostgreSQL for Developers
46mUse PostgreSQL to Step Up Your Game
49mSELECT 'amazing features' FROM "postgresql"
21mA Hands-on Experience with Complex SQL
45mSELECT 'amazing_features' FROM "postgresql"
43mSQL vs Prejudice
