INNER JOIN — only matching rows. LEFT JOIN — all from left table.
Example:
1-- INNER JOIN: Only customers with orders2SELECT c.name, o.total3FROM customers c4INNER JOIN orders o ON c.id = o.customer_id;5Result: 3 rows (only customers with orders)67-- LEFT JOIN: All customers, even without orders8SELECT c.name, o.total9FROM customers c10LEFT JOIN orders o ON c.id = o.customer_id;11Result: 5 rows (all customers, NULL for no orders)
When to use:
BA use: Analyze relationships, find gaps in data.