0% found this document useful (0 votes)
47 views8 pages

Binary Relational Operations

dbms

Uploaded by

vismithapavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views8 pages

Binary Relational Operations

dbms

Uploaded by

vismithapavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Binary Relational

Operations
Explore the key concepts of binary relational operations, including the JOIN
operation, Cartesian product, and various types of joins.
The JOIN Operation

Join Condition
Definition
The join condition is specified on attributes from the
The result of the JOIN is a relation with attributes two relations and evaluated for each combination of
from both input relations. tuples.

1 2 3

Difference from Cartesian Product


JOIN only includes tuples that satisfy the join
condition, unlike Cartesian product which includes
all combinations.
Types of Joins
Inner Join Outer Joins Natural Join

Returns rows from both tables that Keeps all tuples from one or both Performs an inner join on
satisfy the join condition. tables, even if there is no match. common attributes and eliminates
duplicates.
Theta Join
General Join Condition Equality Join Natural Join
A common case is the equality Natural join does not use any
The join condition can use any (=) join, also called an equi- comparison operators, just
comparison operator (=, <, >, join. matches common attributes.
etc.).
Left Outer Join

Keeps All Tuples from Left Relation Fills in Null Values


Left outer join retains all tuples from the left relation, Unmatched tuples are padded with NULL values in the
even if there is no match in the right relation. result.
Right Outer Join

Keeps All Tuples from Right Relation Fills in Null Values


Right outer join retains all tuples from the right relation, Unmatched tuples are padded with NULL values in the
even if there is no match in the left relation. result.
Full Outer Join
Keeps All Tuples
Full outer join retains all tuples from both the left and right relations.

Fills in Null Values


Unmatched tuples are padded with NULL values in the result.

Combines Left and Right


The result is the union of the left and right outer joins.
Cartesian Product
Cartesian Product Combines all tuples from two relations without any
conditions.

Result The result has all possible combinations of tuples


from the two input relations.

Difference from Join Join only includes tuples that satisfy the join
condition.

You might also like