Data with Baraa on YouTube · Open on YouTube
Foundations: spreadsheets, data literacy and first SQL · Novice · Lesson 13 of 99 · 40 min video, then about 5 hours of practice
SQL joins: combining tables without multiplying rows
After this you can choose between INNER, LEFT and FULL joins, join on composite keys, and check whether a join has duplicated rows.
Why it matters
Joins are where analyst SQL goes wrong most often. Learn what each join type keeps, then build the habit of counting rows before and after every join: if a 'one-to-many' join turns 10,000 orders into 14,000 rows, you have just inflated revenue by 40 percent. Also learn why a WHERE condition on the right-hand table silently turns a LEFT JOIN into an INNER JOIN.
How to use this resource
A visual, careful explanation of the basic join types, with diagrams of exactly which rows survive.