explain different types of jions with examples briefly?
Answer Posted / 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 View All Answers
Explain concepts of analysis services?
What is the use of @@spid?
What is the process of normalising?
What are the different types of triggers in SQL SERVER?
Which tcp/ip port does sql server run on? How can it be changed?
Mention the differences between substr and charindex in sql server.
What are the pros and cons of putting a scalar function in a queries select list or in the where clause?
What is indexing in sql server with example?
Tell me about normalization in DBMS.
Can we insert data if clustered index is disabled?
How to set the current database in ms sql server?
What have included columns when we talk about sql server indexing?
Explain few examples of stored procedure over triggers?
What is serializable?
How do you migrate data from mssql server to azure?