SQL Reference
Fast lookup for SQL clauses, functions, and query patterns. Each page shows syntax, a working example you can run, and what usually breaks. Use this when you know what you need and just want the exact form. For the why, head to the Learn section.
Start here #
- SQL Syntax Types: a one-page map of keywords by category (DML vs DDL, set operators, window functions, ...).
Categories #
- Query Structure:
SELECT,FROM,WHERE,GROUP BY,HAVING,ORDER BY,LIMIT, set operators. - Joins: inner, left, right, full outer, cross.
- Functions:
CASE, rounding, aggregates, date, string. - Window Functions:
ROW_NUMBER,RANK,DENSE_RANK,LAG/LEAD,NTILE, first/last value. - Subqueries & CTEs: scalar/row/table subqueries,
EXISTS,WITH, correlated + recursive. - Data Types & NULLs:
CAST,IS NULL,COALESCE,IFNULL/NULLIF. - Patterns: top-N per group, dedupe latest row, pivot/unpivot.
- Dialect Notes: where this platform's SQL (DuckDB-flavored Postgres) diverges from other engines.
Tip
Reference pages are shallow on purpose. If a page feels thin, that's the point: you're here to look up syntax, not learn a concept. When you want depth, every topic has a matching lesson in Learn.
Next step: skim SQL Syntax Types once for the map, then bookmark this page as your jumping-off point.