customers LEFT JOIN orders ON ... returns…
Options
- Only the customers who have at least one order in the table
- All customers; order columns are NULL when there is no order (Correct option)
- All orders; customer columns are NULL when a customer is missing
- The Cartesian product of both the tables, with all the pairs
Answer
All customers; order columns are NULL for customers without orders
Why
An INNER JOIN keeps only rows that have a match on both sides.
A LEFT JOIN keeps EVERY row from the left table (customers). When a customer has no orders, the order columns are filled with NULL.
Useful for 'show all customers, with their orders if any', or to find customers with no orders: WHERE orders.id IS NULL.
Remember
LEFT JOIN keeps all left rows; missing matches become NULL.