Relational Algebra Flashcards
What is relational algebra?
A form of algebra that has relations in place of operators.
How does relational algebra enable database querying?
SQL queries are converted to relational algebra via the Relational Data Management System.
What are the 3 main types of relational algebra operations?
Unary, Set, Binary.
What are the 3 Unary operations?
SELECT : New relation based on the tuples that satisfy the select condition.
PROJECTION : New relation of certain attributes.
RENAME : Rename a relation as well as specified attributes.
What are the 3 types of Set operations?
Union, Intersection, Difference, Cartesian Product.
What are the 3 Joins in the Binary operations?
Theta Join : New relation containing all tuples of a cartesian product that satisfy the join condition.
Equijoin : Create a relation from R1 and R2 where the equality comparotor between the relations is satisfied. For example Student.age == Teacher.age
Natural Join : An equijoin of R1 and R2 over all common attributes.