Posts

Showing posts with the label Inner Join

Types of Join in SQL Server

Image
What is join?? An SQL  JOIN  clause is used to combine rows from two or more tables, based on a common field between them. There are many types of  join . Inner Join Equi-join Natural Join Outer Join Left outer Join Right outer join Full outer join Cross Join Self Join Using the Code Join  is very useful to fetching records from multiple tables with reference to common column between them. To understand  join  with example, we have to create two tables in SQL Server database. Employee Hide     Copy Code create table Employee( id int identity ( 1 , 1 ) primary key , Username varchar ( 50 ), FirstName varchar ( 50 ), LastName varchar ( 50 ), DepartID int ) Departments Hide     Copy Code create table Departments( id int identity ( 1 , 1 ) primary key , DepartmentName varchar ( 50 ) ) Now fill  Employee  table with demo records like that. Fill  Departm...