InterviewSolution
Saved Bookmarks
| 1. |
What is an Equi Join? |
||||||||||||||||||||||||||||||||||
|
Answer» Equi Joins are a type of INNER Joins where a join is performed between two or more tables using a common column between them. Using the equality sign ( = ), it compares the data in two columns, if the data is the same, it retrieves it. Syntax: SELECT * FROM Table1, Table2WHERE Table1.ColumnName = Table2.ColumnName; OR SELECT column_list FROM Table1, Table2WHERE Table1.ColumnName = Table2.ColumnName; OR SELECT * FROM Table1 JOIN Table2 ON Table1.ColumnName = Table2.ColumnName;Example: Consider the tables Employee and State. Employee Table
State Table
Now, lets perform Equi-join using the equality operation and the WHERE clause as follows; SELECT Emp_Name, State_Name FROM Employee, State WHERE Employee.State_ID = State.State_ID;Output:
|
|||||||||||||||||||||||||||||||||||