Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Full join and Inner join in MS SQL Server

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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.

Syntax –

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.

Syntax –

select select_list 
from table1 inner join table2 on join_predicate
                        (OR)
select * 
from table1 inner join table2 

Note –
These joins can be applied to multiple tables.



Example –
There are two tables namely Student and Marks from the university database given below.

Table – Student

NameRollnoAgeCourse
Ayra11119CSE
Mona11218EEE
Veena11319ECE
Neena11418Mech


Table – Mark

NameRollnoCourseGPA
Ayra111CSE9.6
Mona112EEE9.5
Veena113ECE7.7
Neena114Mech7.5



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 

NameRollnoAgeCourseGPA
Ayra11119CSE9.6
Mona11218EEE9.5
Veena11319ECE7.7
Neena11418Mech7.5



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 

NameRollnoCourse
Ayra111CSE
Mona112EEE
Veena113ECE
Neena114Mech

My Personal Notes arrow_drop_up
Last Updated : 14 Jul, 2020
Like Article
Save Article
Similar Reads