What is the differecne between equi-join and inner-join and
natural join..Is there any difference or all are same?
Answer Posted / sobia g.
An inner join is a join with a join condition that may contain both equality or non-equality sign whereas an equijoin is a join with a join condition that only contain only equality sign.
So we can say an equijoin is a type of inner join containing (Equal)= operator in the join condition.
It is good to know the difference between join and INNER JOIN keywoed. Actually there is no difference. If we write JOIN then by default INNER JOIN is performed. In the example it is also shown.
The following example will make you more clear.
In this example I used data as in example of Difference between Inner join and Outer join
SQL> select s.name,d.deptname from dept d, student s where d.deptid=s.deptid;
NAME DEPTNAME
--------------- ----------
Rafi CSE
Arju CSE
This example represents both INNER join and equijoin.
SQL> select s.name,d.deptname from dept d INNER JOIN student s on d.deptid=s.deptid;
NAME DEPTNAME
--------------- ----------
Rafi CSE
Arju CSE
Above example also represents both INNER join and equijoin.
SQL> select s.name,d.deptname from dept d INNER JOIN student s on d.deptid<>s.deptid;
NAME DEPTNAME
--------------- ----------
Rafi EEE
Raju EEE
Arju EEE
Raju CSE
Above example represents an inner join but not a equijoin.
SQL> select s.name,d.deptname from dept d JOIN student s on d.deptid<>s.deptid;
NAME DEPTNAME
--------------- ----------
Rafi EEE
Raju EEE
Arju EEE
Raju CSE
Above example show JOIN and INNER join keyword is same. If we don't specify INNER then by default inner join is performed.
Is This Answer Correct ? | 52 Yes | 11 No |
Post New Answer View All Answers
What is the New in SQL server 2008?
What are sub reports?
What is 1nf 2nf and 3nf?
Why should you use or avoid select * statements?
What do you understand by mirroring and mention the advantages of the mirroring?
What happens if null values are involved in comparison operations?
What is SQL Azure Firewall?
What is report snapshot in ssrs?
What are sql server functions?
Tell me what are cursors and when they are useful?
What is Cross Join and in which scenario do we use Cross Join?
What is the difference between web edition and business edition?
How can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role?
How will you optimize a stored procedure optimization?
What is the usage of the sign function?