SQL-Server-Joins .

In this session i have discussed the SQL Server joins .

The SQL Server Joins are used to retrieve data from more than one table .


Types of Joins

There are four types of joins given below .

1-Inner Join

2-Outer Join

3-Cross Join

4-Self Join


Inner-Join

It is most commonly used join in sql server . It is used to retrieve the data from two or more than two tables . It is most important things one column same in both tables or more than two tables on which you are going to apply the inner join .


Outer Join

There are three types of outer join given below .

a)Left Outer Join

b)Right Outer Join

c)Full Outer Join

a)Left Outer Join - It is used to retrieve all the records from left table(tbl1) and matches records from right table(tbl2) if there are no match then it will return null .

b)Right Outer Join - It is used to retrieve all the records from right table(tbl2) and matches records from left table(tbl1) if there are no match it will return null .

Full Outer Join - It is combination of left and right join .


Cross Join -

It is used to produce the result set in which the each row of the first table multiplied with the each row of the second table . This kind of result is called the cartensian product .


Self Join - It is one type of join in which we give the two temparary name(aliases) of one table and join itself .


Welcome to AndroidATPoint.

back image                     next image