SQL Inner Join/ SQL Natural Join:
Inner Join = Equi Join = Natural Join is the usually same.An inner join has an ON clause that specifies the join conditions. Rather than having a huge rowset in memory and filtering the data, this join extracts only the data that meets the join conditions. The keyword INNER is optional because a JOIN clause will be INNER by default. An inner join is called equi-join when all the columns are selected with a *, or natural join otherwise.
inner or natural joins - just a "regular" join.
Employee table: | |
---|---|
LN | D_Id |
Kamal | 31 |
Jones | 33 |
Singh | 33 |
Smith | 34 |
Robinson | 34 |
Jasper | 36 |
Department Table: | |
---|---|
Department Name | D_Id |
Sales | 31 |
Engineering | 33 |
Clerical | 34 |
Marketing | 35 |
Example inner join (ANSI 92 standard syntax):
SELECT * FROM employee
INNER JOIN department
ON employee.D_id = department.D_id
Example inner join (non-standard syntax):
SELECT * FROM employee, department
WHERE employee.D_id = department.D_id
Inner join result :
LN | D_Id | Department Name | D_Id |
Smith | 34 | Clerical | 34 |
Jones | 33 | Engineering | 33 |
Robinson | 34 | Clerical | 34 |
Singh | 33 | Engineering | 33 |
Kamal | 31 | Sales | 31 |