Returns all records from the right table, and matched ones from the left.
Query -
SELECT Customers.name, Orders.order_amount
FROM Customers
RIGHT JOIN Orders
ON Customers.customer_id = Orders.customer_id;
Result and observation -
name | order_amount |
---|---|
Alice | 250 |
Alice | 125 |
Bob | 300 |
NULL | 400 |
Order 104 is shown even though the customer is missing.