02-07-2013, 01:08 PM
JOINS AND VIEWS
JOINS AND VIEWS.pptx (Size: 89.68 KB / Downloads: 17)
INTRODUCTON
JOINS :
A join is a query in which data is retrieved from one or more relations.
The join operation is one of the most useful operation in the relational algebra. It is used to combine information from two or more relations.
TYPES OF JOINS
Joins are classified into two types.They are:
1.Natural join
2.outer join
outer join is further classified into three types.They are:
(i) left outer join
(ii) right outer join
(iii) full outer join
NATURAL JOIN
Natural join is the binary operation that allows us to combine certain selections and a cartesian product into one operation.
It is denoted by the “join” symbol
It can also be defined as a relational operation that links tables by selecting only the rows with common values in their common attributes.
The natural join will perform the following tasks:
Determine the common attributes by looking for attributes with identical names and compatible data types.
If there are no common attributes,return the relational product of two tables.
Select only the rows with commo n values in the common attributes.
OUTER JOIN:
An outer join is an extended form of the natural join.
In this,the rows in one table having no matching rows in the other table will also appear in the result table with nulls.
LEFT OUTER JOIN
It returns the matching rows from the tables being joined and also non matching rows from the left table in the result and places null values in the attributes that comes from the right table.
FULL OUTER JOIN
It is the union operation for the left outer join and right outer join.
After the join operation ,it extends with null tuples from the left hand side relation that does not match with any tuples from the right hand side and adds them to the result and vice versa.