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
Difference between LEN() and DATALENGTH() in sql server ?
Tell me what is the order in which the sql query is executed?
Write the queries for commands like Create Table, Delete table, Drop Table etc.
What is database mirroring?
What are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
What is normalization? Explain different forms of normalization?
Can select statements be used on views in ms sql server?
What is the difference between for auto and for nested?
How to insert data with null values?
What are the disadvantages of indexes?
What happens if null values are involved in comparison operations?
What is the difference between dataadapter and datareader?
What is 1nf normalization form?
What are the five characteristics of good data?
What are views used for?