Summary of the Relational Algebra Operations

Summary of the Relational Algebra Operations
The relational algebra operations are summarized in Table 4.1.
Table 4.1 Operations in the relational algebra.
Operation Notation Function
Selection σpredicate(R) Produces a relation that contains only those tuples of R that
satisfy the specified predicate.
Projection Πa1, . . . , an(R) Produces a relation that contains a vertical subset of R, extracting
the values of specified attributes and eliminating duplicates.
Union R ∪ S Produces a relation that contains all the tuples of R, or S, or both
R and S, duplicate tuples being eliminated. R and S must be
union-compatible.
Set difference R − S Produces a relation that contains all the tuples in R that are not in
S. R and S must be union-compatible.
Intersection R ∩ S Produces a relation that contains all the tuples in both R and S.
R and S must be union-compatible.
Cartesian R × S Produces a relation that is the concatenation of every tuple of
product relation R with every tuple of relation S.
Theta join R 1F S Produces a relation that contains tuples satisfying the predicate F
from the Cartesian product of R and S.
Equijoin R 1F S Produces a relation that contains tuples satisfying the predicate F
(which only contains equality comparisons) from the Cartesian
product of R and S.
Natural join R 1 S An Equijoin of the two relations R and S over all common
attributes x. One occurrence of each common attribute is eliminated.
(Left) Outer R 5S A join in which tuples from R that do not have matching
join values in the common attributes of S are also included in the
result relation.
Semijoin R 2F S Produces a relation that contains the tuples of R that participate
in the join of R with S satisfying the predicate F.
Division R ÷ S Produces a relation that consists of the set of tuples from R defined
over the attributes C that match the combination of every tuple
in S, where C is the set of attributes that are in R but not in S.
Aggregate IAL(R) Applies the aggregate function list, AL, to the relation R to define
a relation over the aggregate list. AL contains one or more
(<aggregate_function>, <attribute>) pairs.
Grouping GAIAL(R) Groups the tuples of relation R by the grouping attributes, GA,
and then applies the aggregate function list AL to define a new
relation. AL contains one or more (<aggregate_function>,
<attribute>) pairs. The resulting relation contains the grouping
attributes, GA, along with the results of each of the aggregate
functions.

Summary of the Relational Algebra Operations Summary of the Relational Algebra Operations Reviewed by Shopping Sale on 22:12 Rating: 5

No comments:

Powered by Blogger.