A left outer join combines two tables while keeping every row from the left table. Matching data from the right table is added when it exists; otherwise, the right-side columns contain missing values. Use it when the left table defines the complete audience you must retain. section 7.2
Keep every customer for email generation
Join Customer Master Data to Transaction History by CustomerID. Customers with no purchases still appear and can receive an email. A customer with two transactions appears twice, once for each matching transaction. A transaction-only customer is excluded because it has no matching master-data row. section 7.2
Choose the join type by deciding which records the final result must keep:
- Use a left outer join to preserve all left-table customers, including those without transactions. section 7.2
- Use an inner join when only rows matched in both tables should remain. section 7.2
- Use a right outer join to retain right-table-only records, such as records useful for audits. section 7.2
|
CustomerID |
FirstName |
Age |
City |
ProductName |
PurchaseDate |
Amount |
| CUST001 |
Rebecca |
53 |
Manchester |
? |
? |
? |
| CUST002 |
Maicol |
41 |
Milan |
Sleep Lamp |
2025-01-25 |
439.96 |
| CUST002 |
Maicol |
41 |
Milan |
Essential Oil Diffuser |
2025-03-10 |
288.00 |
| CUST003 |
Giulia |
37 |
Milan |
? |
? |
? |
Inspect the combined output: missing transaction fields mark customers without purchases, while repeated customer rows represent multiple matching transactions. section 7.2





