Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is inner join the same as equi-join?

Tags:

sql

join

oracle

People also ask

Is Non Equi join and inner join are same?

Equi Join and Non-Equi Joins are types of Inner Joins. Equi Join in SQL is used to retrieve data from multiple tables using an equality condition with the WHERE clause. Non-Equi in SQL is used to retrieve data from multiple tables using any other operator except the equality condition.

Which join is equal to inner join?

An SQL INNER JOIN is same as JOIN clause, combining rows from two or more tables. An inner join of A and B gives the result of A intersect B, i.e. the inner part of a Venn diagram intersection. Inner joins use a comparison operator to match rows from two tables based on the values in common columns from each table.

Is Outer join same as equi join?

Outer join is the same as equi-join, except one of the duplicate columns is eliminated in the result table.


An 'inner join' is not the same as an 'equi-join' in general terms.

'equi-join' means joining tables using the equality operator or equivalent. I would still call an outer join an 'equi-join' if it only uses equality (others may disagree).

'inner join' is opposed to 'outer join' and determines how to join two sets when there is no matching value.


Simply put: an equi-join is a possible type of inner-joins

For a more in-depth explanation:

An inner-join is a join that returns only rows from joined tables where a certain condition is met. This condition may be of equality, which means we would have an equi-join; if the condition is not that of equality - which may be a non-equality, greater than, lesser than, between, etc. - we have a nonequi-join, called more precisely theta-join.

If we do not want such conditions to be necessarily met, we can have outer joins (all rows from all tables returned), left join (all rows from left table returned, only matching for right table), right join (all rows from right table returned, only matching for left table).


The answer is NO.

An equi-join is used to match two columns from two tables using explicit operator =:

Example:

select *
  from table T1, table2 T2
  where T1.column_name1 = T2.column_name2

An inner join is used to get the cross product between two tables, combining all records from both tables. To get the right result you can use a equi-join or one natural join (column names between tables must be the same)

Using equi-join (explicit and implicit)

select *
  from table T1 INNER JOIN table2 T2
  on T1.column_name = T2.column_name

select *
  from table T1, table2 T2
  where T1.column_name = T2.column_name

Or Using natural join

select *
  from table T1 NATURAL JOIN table2 T2

The answer is No,here is the short and simple for readers.

Inner join can have equality (=) and other operators (like <,>,<>) in the join condition.

Equi join only have equality (=) operator in the join condition.

Equi join can be an Inner join,Left Outer join, Right Outer join


If there has to made out a difference then ,I think here it is .I tested it with DB2. In 'equi join'.you have to select the comparing column of the table being joined , in inner join it is not compulsory you do that . Example :-

Select k.id,k.name FROM customer k
inner join  dealer on(
k.id =dealer.id
)

here the resulted rows are only two columns rows

id    name

But I think in equi join you have to select the columns of other table too

Select k.id,k.name,d.id FROM customer k,dealer d
where
k.id =d.id

and this will result in rows with three columns , there is no way you cannot have the unwanted compared column of dealer here(even if you don't want it) , the rows will look like

 id(from customer) name(from Customer) id(from dealer)

May be this is not true for your question.But it might be one of the major difference.