Data Wrangling & Pipelines

Join (Merge)

A join (or merge) combines two tables side by side by matching rows on a shared key — for example attaching each order to its customer's details by matching customer_id. The result is one wider table with columns from both.

The trap is what happens to rows that don't match. An inner join keeps only rows present in both tables; a left join keeps every row from the first table and fills blanks where the second has no match. Choosing the wrong type silently drops or duplicates rows, so always check your row count before and after a join.

If the key isn't unique on both sides, a join can multiply rows — 2 matching rows × 3 matching rows produce 6, a classic accidental blow-up.

Also called
mergejoin