Inner Joins Drop Rows
What happens with no match.
Here's something important about the join you've been using. It's called an inner join. And it only keeps rows that have a match on both sides. Rows without a partner quietly disappear. Sometimes that's exactly what you want. Sometimes it hides the most interesting people.

- The plain JOIN is an INNER JOIN
- Only matched rows survive
- Unmatched rows vanish
Matches only
Think of two circles. One holds customers, the other holds orders. An inner join keeps only the overlap. Customers who have placed at least one order. A customer who signed up, but never bought anything, has no partner in orders, so they're dropped.
Who survives an inner join?
Let's count how many different customers survive an inner join with orders. Run it. Four hundred and sixty three. But Helen has five hundred customers. So thirty seven people vanished from the result, without any warning.
SELECT COUNT(DISTINCT c.customer_id) AS customers_with_orders
FROM customers AS c
JOIN orders AS o ON o.customer_id = c.customer_id;โโโโโโโโโโโโโโโโโโโโโโโโโ โ customers_with_orders โ โโโโโโโโโโโโโโโโโโโโโโโโโค โ 463 โ โโโโโโโโโโโโโโโโโโโโโโโโโ
Summary
An inner join keeps only rows with a match on both sides. Unmatched rows disappear silently. Next, the join that keeps them.
Key takeaways- JOIN = INNER JOIN
- Keeps matches only
- Unmatched rows vanish