SQL TutorialLesson 28Free preview
SQL Left Join
This lesson is part of SQL · All levels
Summary
LEFT JOIN returns all the rows from the left table along with the corresponding rows from the right table; if no pair is present, the right column becomes NULL. This type of data is useful for finding data that hasn't been relational, like customers who never ordered. The table on the left is the first table written after FROM.
Key points
- LEFT JOIN maintains all the left table rows.
- The right-hand table column without a pair will be worth NULL.
- The left table is the table that was first written in the FROM clause.
- Suitable for searching for data that is not correlated with the IS NULL condition in the right column.
- The opposite of left join is right join.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.