Prerequisite – Introduction of MS SQL Server
1. Full Join :
Full join selects all the rows from left and the right tables along with the matching rows as well. If there are no matching rows, it will be displayed as NULL.
select select_list from table1 full join table2 on join _predicate (OR) select * from table1 full join table2
2. Inner Join :
Inner join retrieves the rows that match from left and right tables. If there are no matching rows, NULL is displayed.
select select_list from table1 inner join table2 on join_predicate (OR) select * from table1 inner join table2
These joins can be applied to multiple tables.
There are two tables namely Student and Marks from the university database given below.
1. Full Join :
Full join is applied to the tables Student and Marks and the table below is the result set.
select * from student full join marks
2. Inner join :
Inner join is applied to the tables Student and Marks and the table below is the result set.
select * from student inner join marks
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Difference between Inner Join and Outer Join in SQL
- Difference between Natural join and Inner Join in SQL
- SQL | Join (Inner, Left, Right and Full Joins)
- SQL | Join (Cartesian Join & Self Join)
- Inner Join vs Outer Join
- Left join and Right join in MS SQL Server
- Self Join and Cross Join in MS SQL Server
- Difference between Natural join and Cross join in SQL
- SQL | EQUI Join and NON EQUI JOIN
- Difference between Structured Query Language (SQL) and Transact-SQL (T-SQL)
- Difference between Nested Loop Join and Hash Join
- Difference between Nested Loop join and Sort Merge Join
- Difference between Hash Join and Sort Merge Join
- Difference between Left, Right and Full Outer Join
- Difference between JOIN and UNION in SQL
- SQL Join vs Subquery
- SQL | UPDATE with JOIN
- Mean and Mode in SQL Server
- Copy tables between databases in SQL Server using Import-and-Export Wizard
- Difference between MySQL and MS SQL Server
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.