Relational Algebra Flashcards
(32 cards)
Enables users to specify basic retrieval requests as relational algebra expressions
Relational algebra
Two operation Groups
- Mathematical set theory
- Operation for relational databases
Give some examples of set operations
Union
Intersection
Set difference
Cartesian product
Give some examples of Relational operations
Select
join
project
aggregate
Importance of relational operations
- Provides formal foundation for relational model operations
- Use as a basis for implementing and optimizing queries during the query process
Unary Relational Operations
Select and Project
Select
Ơ
chose a subset of the tuples from a relation that satisfies a given
The degree of the relation results from a select operation is the ________ as the number of attributes of R
same
Property of select
commutative
Project
π
select a certain columns or attributes from R disregarding other columns
Duplicates at project is removed by what process
Duplicate Eliminations
Uses sorting to detect duplicates if not eliminated creates multisets of tuples instead of a set
Duplicate Eliminations
Renaming operation
p
we can rename relations or attribute names
Properties of Project
Not Commutative
Set Theory
Merges two sets
Binary; two sets of tuples
Type compatibility or Union compatibility is checked where
Tuple
Intersection
the result of R ∩ S
a relation that includes all tuples that are both R and S
Properties of Union and Intersection
Commutative
N-ary operations
Set Difference
all tuples that are in R not in S
Properties of Set Difference
Not Commutative
Intersection can be expressed in terms of union and set difference
Cartesian product
Cross product
Binary Operation
Does not need to be union compatible
Combine every member tuple from one relation A with every member tuple of relation B
Join Operator
⋈
longer tuples
Inner join has 2 kinds
Equijoin
Natural
Equijoin
=
One or more pairs of attributes that have identical values in every tuple