Joins - DotNet and DataBase

Wednesday, 1 August 2018

Joins




JOINS:

Joins are used to retrieve the data from different tables by combining columns. By comparing common fields in all tables, data will be retrieved. 
There are different joins available in SQL server.

They are:
  1.  Join/Inner join
  2.   LEFT[Outer] Join
  3.   RIGHT[Outer] Join
  4. FULLJoin
  5. SELFJoin
  6. CROSSJOIN
Let us create two tables are below.

CREATE TABLE tbl_Dept(

 DeptID INT PRIMARY KEY IDENTITY(1,1),
 Department VARCHAR(50)

 )
CREATE TABLE tbl_Employees(

 EmpID INT PRIMARY KEY IDENTITY(1,1),
 EmpName VARCHAR(50),
 DeptID INT
 )

No comments:

Post a Comment

x

Get Updates On

Discussion updates

Straight Into Your INBOX!

Enter your email address to subscribe to this website and receive notifications of new posts by email.