Skip
Arish's avatar

172. LEFT OUTER JOIN


LEFT JOIN

Returns ALL rows from left table, matching from right.

sql
1SELECT s.name, c.course_name
2FROM students s
3LEFT JOIN courses c ON s.course_id = c.id;

Students without courses show NULL for course_name.