Natural Join
- It is a join technique which compares the common attributes of the tables to join the tables.
- We have to check for the common attributes in the tables well before executing the join query.
- NATURAL JOIN is the keyword used in the query to perform join.
- Natural join cause problems when new columns are added or columns are renamed or more than one set of common attributes are available. Hence, Natural join is not recommended.
Example:
SELECT
* FROM Employee NATURAL JOIN Course_Registration;
The result
generated by the above query is slightly different in structure from that of
Equi-join. See the post on Equi-join for table instances STUDENT and COURSE_REGISTRATION
and to compare the result with Natural join. The result of the above SQL query
is given in Table 1;
| 
RegNo | 
SName | 
Gen | 
Phone | 
Courses | 
| 
R1 | 
Sundar | 
M | 
9898786756 | 
Database | 
| 
R2 | 
Ram | 
M | 
9897786776 | 
Database | 
| 
R3 | 
Karthik | 
M | 
8798987867 | 
Data
  Structures | 
| 
R4 | 
John | 
M | 
7898886756 | 
Multimedia | 
 Table 1
*********
Go to Equi-join in SQL page
Go to Multiple choice questions in SQL/Relational algebra page
 
No comments:
Post a Comment