explain different types of jions with examples briefly?

Answers were Sorted based on User's Feedback



explain different types of jions with examples briefly?..

Answer / hari

Inner join
outer join--left outer join ,right outer join , full outer
join
Cross Join

Is This Answer Correct ?    4 Yes 0 No

explain different types of jions with examples briefly?..

Answer / soni

Inner join: This type of join displays matched rows from
tables.
this is based on equality condition ,so also called
equijoin.
exp- select empid,d.deptid,deptname,empname,location,salary
from emp e inner join dept d on e.deptid=d.deptid

Cross join: this is not based on any condition. It results
every row of one table matching with every row of another
table.
exp- select * from emp cross join dept

Self join: This ype of join joins a table to itself.


outer join:
Three types -
a.left outer join: It reults mathed rows from both tables
as well as all unmatched rows from left table.
exp- select empid,d.deptid,deptname,name,location,salary
from emp e left outer join dept d
on e.emp=d.dept

it displays all data from emp table .

right Outer join:It reults mathed rows from both tables as
well as all unmatched rows from right table.
exp- select empid,d.deptid,deptname,name,location,salary
from emp e right outer join dept d
on e.emp=d.dept

it displays all data from dept table .

Full Outer Join: This type of join results all matched
rows from both tables as well as umatched rows from both
tables.
exp.-select empid,d.deptid,deptname,name,location,salary
from emp e full outer join dept d
on emp e=d.dept d
It displays all matched and unmatched rows from both emp
and dept tables.

Is This Answer Correct ?    5 Yes 3 No

Post New Answer

More SQL Server Interview Questions

What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?

0 Answers  


What is row-level compre?

0 Answers  


What is sql language?

0 Answers  


Explain indexes disadvantages?

0 Answers  


Does order by actually change the order of the data in the tables or does it just change the output?

0 Answers  






Where can you find the error log information? : sql server database administration

0 Answers  


What is enhanced database mirroring in sql server 2008?

0 Answers  


How can we check the sql server version?

0 Answers  


where the connection string store in the database

0 Answers   HCL, Wipro,


What are indexes in sql?

0 Answers  


What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas

0 Answers  


what is the difference between table and view

1 Answers  


Categories