JOINs combine rows from multiple tables. INNER JOIN returns only matching rows. LEFT JOIN returns all left table rows plus matches from the right. This is how you query data split across multiple related tables.
Joining Tables
-- INNER JOIN (matching rows only)
SELECT u.name, o.total
FROM users u
INNER JOIN orders o ON u.id = o.user_id;
-- LEFT JOIN (all users, even with no orders)
SELECT u.name, o.total
FROM users u
LEFT JOIN orders o ON u.id = o.user_id;
-- Multiple joins
SELECT u.name, p.name AS product, o.total
FROM orders o
JOIN users u ON o.user_id = u.id
JOIN products p ON o.product_id = p.id;