SQL TutorialLesson 29Free preview
SQL Right Join
This lesson is part of SQL · All levels
Summary
RIGHT JOIN is the opposite of LEFT JOIN, i.e. all the rows of the right table are maintained and their matches from the left table. The left-handed column of the table that has no pair becomes NULL. In practice, most programmers prefer LEFT JOIN because of the left-to-right query reading stream.
Key points
- RIGHT JOIN maintains all the rows of the table to the right.
- The left table column without a pair becomes NULL.
- From a right join b is equal to from b left join a.
- It can be used to find the right data that hasn't been correlated.
- LEFT JOIN is more commonly used because it's more intuitive to read.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.