Practice
Postgres Practice
IntermediateHands-on lessons on the features real Postgres has beyond standard SQL - JSONB, arrays, RETURNING, upsert, CTEs, window functions, and recursive queries - against a real Postgres running in your browser.
Lessons
- JSONB: read fields out of a JSON column
- JSONB: filter rows with @>
- Arrays: a column that holds a list
- RETURNING: get the row back from an INSERT
- UUID primary keys with gen_random_uuid()
- Upsert: ON CONFLICT DO UPDATE
- Fix the bug: Postgres's strict GROUP BY
- CTEs: naming a step with WITH
- Chaining CTEs
- Window functions: RANK with PARTITION BY
- LAG: comparing to the previous row
- Recursive CTEs (capstone)