Grokking SQL for Tech Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
RIGHT OUTER JOIN
On this page

A RIGHT OUTER JOIN in SQL is a type of join that combines rows from two or more tables based on a specified condition and includes all rows from the right (or second) table, regardless of whether there is a match in the left (or first) table. If there is no match, NULL values are filled in for columns from the left table.

Syntax

SELECT * FROM table1 RIGHT JOIN table2 ON table1.column_name = table2.column_name;

Example

Consider we have two tables, students and grades, with information about students and their respective grades:

Now, let's perform a RIGHT OUTER JOIN

.....

.....

.....

Like the course? Get enrolled and start learning!

On this page