Last time you learned INNER JOIN, which only shows records that exist in BOTH tables. But what if you want to see ALL customers, even those who never placed an order?
INNER JOIN would hide customers without orders. Sometimes you need to keep all records from one table regardless of matches.
Engagement Message
Can you think of a business scenario where you'd want to see all customers, including those with no orders?
LEFT JOIN solves this! It keeps ALL records from the left table (the first one mentioned) and adds matching data from the right table.
When there's no match, the right table's columns show NULL values instead of disappearing entirely.
Engagement Message
Which table is "left" in this query: FROM customers LEFT JOIN orders
?
Here's our familiar data:
CUSTOMERS
ORDERS
Remember: INNER JOIN excluded Lisa because she had no orders.
Engagement Message
What do you think LEFT JOIN will do with Lisa?
LEFT JOIN results would look like:
