Skip to content
Play · 1 h

Data · SQL for product teams

Joins without the fear

Lesson 2 of 4 · 1 h · with Lucía Moreno

Combine users, notes and payments into one answer, and know which join to use.

The interesting questions always span more than one table: which users wrote notes last week, which of them pay, which stopped.

Inner and left joins

An inner join keeps only rows that match on both sides. A left join keeps everything on the left and fills the gaps with nothing. We draw both on paper before writing either.

A common mistake

Joining two one-to-many tables at once multiplies your rows. We make the mistake on purpose, spot it, and fix it.