Showing posts with label joins study material. Show all posts
Showing posts with label joins study material. Show all posts

Wednesday, 14 August 2013

Joins in SQL Server

Join in SQL Sever

When we need to select data from more than one table then we can use joins in SQL Server. We can join two or more tables on the basis of common column between these tables.

Consider the following table which I am using in this example:-

Table 1:- Emp_Record

create table Emp_Record(eid int primary key, ename varchar(100), email varchar(100))



Figure 1

Table 2:-emp_sal

create table emp_sal(eid int foreign key references emp_record(eid), salary int, ispermanent varchar(100))



Figure 2
Types of Joins
Inner Join

When we need to select the common data from more than one table then we will use inner join. It will select only those data which will be common in these two tables.