Learn to combine data across tables in PostgreSQL with confidence — INNER, LEFT, RIGHT and FULL joins, self and cross joins, and the relationships behind them. You will model one-to-many and many-to-many data, write correct multi-table queries, and avoid the accidental Cartesian products that silently corrupt results.
Watch the free preview
What a join is — reassembling data with INNER JOIN — free to watch, no account needed.
What you'll learn
- Combine data across multiple tables using the full family of SQL joins
- Choose correctly between INNER, LEFT, RIGHT and FULL joins for a given question
- Model one-to-many and many-to-many relationships with foreign keys and junction tables
- Write self joins and cross joins for hierarchies and combinations
- Diagnose and prevent accidental Cartesian products that inflate result sets
Syllabus
Foundations of Joining Tables
What a join is — reassembling data with INNER JOINFree preview
Join conditions, aliases and joining several tables
Outer Joins — Keeping Unmatched Rows
LEFT JOIN and finding what is missing
RIGHT and FULL OUTER joins
Modelling Relationships Between Tables
One-to-many relationships and aggregating across joins
Many-to-many relationships with junction tables
Advanced Joins and Avoiding Pitfalls
Self joins and cross joins
Avoiding accidental Cartesian products
Lab — 10 Exercises & Solutions
Exercises 1–5
Exercises 6–10