SQL - LEFT and RIGHT JOIN
You have two tables:
order_id | customer_id
1 | 101
2 | 102
3 | 103
customer_id | name
101 | John
102 | Jane
You want to list all orders with customer names, but show 'Unknown' if no customer found.
Which SQL query correctly achieves this?
Orders:order_id | customer_id
1 | 101
2 | 102
3 | 103
Customers:customer_id | name
101 | John
102 | Jane
You want to list all orders with customer names, but show 'Unknown' if no customer found.
Which SQL query correctly achieves this?
