In this lesson we are going to study about Equi joins in a database.
Equi Join or Theta Join:
- An Equi Join is a type of joins the tables based on the columns in two table with same values.
- In Equi join ,the join condition must have an Equility operator.
- Using other comparison operators (such as <) disqualifies a join as an equi-join.
Example: In the below diagram we are having two Table,Table:A and Table:B. In Table:A we are having five records and Table:B is having four
records which is also in Table:A if we do the Equi join on Table:A column X with Table:B column Y,
this will retrun the record which are common in both the table A column X and Table:B column Y .
NOTE: The columns X of Table A and columns Y of Table B Datatype must be same and the resulting table is having all the columns of Table:A ,and Table:B.
Syntex:
Explicit Equi join:
SELECT *
FROM Table1
JOIN Table2 ON Table1.columnX= Table2. columnY ;
Implicit Equi join:
SELECT * FROM Table1 , Table2 WHERE Table1.columnX= Table2. columnY ;
Related Article
- Join
- Cross Join
- Non Equi Join
- Self Join
- Natural Join
- Join with Using clause.
- Join with ON clause
- Outer Join. (comming soon.)
I am interested in hearing your feedback, so that I can improve my articles and learning resources for you.connect with us on facebook, twitter
Share
Did you enjoy reading this and found it useful? If so, please share it with your friends: