Relational Algebra
Basic Operations in Relational Algebra
Select
- The select operation is used for selecting a subset of tuples from a relation that satisfy a selection condition.
- Example: σ_age>30 (Employee) selects all employees older than 30.
Project
- The project operation is used for choosing required columns from a relation.
- Example: π_name,age (Employee) selects name and age columns from Employee table.
Union
- The union operation combines tuples from two relations and eliminates duplicate tuples.
- Example: Employee ∪ Manager shows all records from both Employee and Manager tables.
Set Difference
- The set difference operation shows tuples that are in one relation but not in the other.
- Example: Employee - Manager shows records that are in the Employee table but not in the Manager table.
Cartesian Product
- The cartesian product operation combines tuples from two relations.
- Example: Employee x Department shows all possible combinations of Employee and Department records.
Additional Operations in Relational Algebra
Rename