Chains of joins
Questions often need more than two tables. Just keep joining, one table at a time, each with its
own ON:
SELECT o.id AS order_id, p.name AS product, oi.quantity
FROM orders o
JOIN order_items oi ON oi.order_id = o.id
JOIN products p ON p.id = oi.product_id
WHERE o.order_date = '2026-10-30'An order has several lines in order_items, and each line is for one product. So this gives one
row per order line, with the product's name attached.
Read the arrows in the schema panel as a map: order_items.order_id → orders.id,
order_items.product_id → products.id. Each ON follows one arrow.