Relational Algebra Flashcards
Unary Relational Operations
Operations on one set:
Select: sigma: σ
Project: pi: π
Rename: rho: ρ
Select: σ
Selects entire entries from a table
Project: π
Selects only specified attributes
Rename: ρ
Renames attributes or entities
Binary Operations:
Operations on two sets:
Union: U
Intersection: ∩
Set Difference: -
Union
Includes all tuples from R and S, or R, or S
Intersection
Includes all tuples in R and S
Set Difference:
Includes all the tuples in R but not S (R-S)
Commutative Operatiosn
Union and Intersection
Joins:
Binary Operators:
Cross Product: X
Theta: Θ
Equi-join Θ=
Natural Join: *
Cartesian Product / Cross Product
Exhausting pairing
Theta Join
A join based on any sort of equality, can be combined with ANDs
Equijoin
A join based on only strict equality pairing
Natural Join
Removes superfluous attributes in an equijoin situation
Outer Joins
Keeps tuples in R even if they aren’t in S