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)
- Left join and Right join in MS SQL Server
- Self Join and Cross Join in MS SQL Server
- SQL | Join (Cartesian Join & Self Join)
- Inner Join vs Outer Join
- SQL | EQUI Join and NON EQUI JOIN
- Difference between Structured Query Language (SQL) and Transact-SQL (T-SQL)
- Difference between Left, Right and Full Outer Join
- Mean and Mode in SQL Server
- Difference between MySQL and MS SQL Server
- Create, Alter and Drop schema in MS SQL Server
- Difference between Derby and MS SQL Server
- Difference between Redis and MS SQL Server
- Union and Union All in MS SQL Server
- varchar, varchar(max) and nvarchar in MS SQL Server
- text, ntext, binary, varbinary and varbinary(max) in MS SQL Server
- Difference between char and nchar : MS SQL Server Datatypes
- Numeric and Date-time data types in 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.