SQL FULL JOIN – Everything You Need to Know with Examples

Tutorial Playlist

What is FULL JOIN in SQL?

Under SQL joins, FULL JOIN is a keyword, which is used to select all records from the right table and also from the left table

FULL JOIN in SQL

The FULL JOIN basically returns all records from the left table and also from the right table. For example, let’s say, we have two tables, Table A and Table B. When FULL JOIN is applied on these two tables, it returns us all records from both Table A and Table B. If the condition is not met, then the null value is displayed instead.
A Brief Introduction to Full Join

SQL FULL JOIN Syntax

SELECT columns<br>
FROM table1 name<br>
FULL JOIN table2 name<br>
ON table1.coumn_x = table2.column_y;<br>

where SELECT, FULL JOIN, and ON are the keywords, columns are the list of columns, table1 is the first table, table2 is the second table, and column_x and column_y are the columns for performing Left Join, followed by a semicolon.

Become a Database Architect

SQL FULL JOIN Example

Let’s apply FULL JOIN to two tables, the employee table, and the department table

Select employee.e_name, employee.e_dept, department.d_name, department.d_location from employee<br>
FULL JOIN department<br>
ON employee.e_dept = department.d_name;

Syntax

 

After writing the query, click on the execute button to check for errors. Once the query is executed, a message appears like ‘Commands completed successfully.
This brings us to the end of this tutorial section on JOIN operators.

Take your skills to the next level by enrolling in the SQL Training Course today and gaining hands-on experience. Also, prepare for job interviews with our SQL joins interview questions, prepared by industry experts.

About the Author

Technical Content Writer | Software Developer

Nirnayika Rai is a Software Engineer and Technical Content Writer with experience in full-stack development, cloud platforms, and software systems. She creates clear, well-structured content that helps developers understand and apply technical concepts with confidence. Her work combines coding knowledge with a strong focus on clarity, accuracy, and practical relevance.