Thirteen curated Postgres-flavoured SQL topics an AI engineer actually needs in production: SELECT/JOIN/aggregation fundamentals, CTEs, window functions, deduplication & split sampling for ML datasets, feature-aggregation queries, time-series LAG/LEAD, idempotent UPSERT pipelines, pgvector similarity search, JSONB operators for AI metadata, HNSW/IVFFlat indexing, EXPLAIN ANALYZE plan reading. Each topic has a friendly analogy, an ASCII data-flow diagram, three worked examples, a common mistake, and a production failure playbook.