Lesson 17 of 3253%
(Progress persistence is disabled until Phase 9)
SQL
Beginner
LEFT JOIN
Get all records from the left table.
LEFT JOIN
Get all records from the left table.
Example
-- LEFT JOIN includes users even if they have no orders
SELECT u.name, o.id AS order_id FROM users u LEFT JOIN orders o ON u.id = o.user_id;
Test it Yourself