Relational Algebra Flashcards
Relational algebra
Relational algebra is a framework for working with data stored in relational databases. It provides a set of operations for manipulating tables and their relationships to generate new tables.
Relational algebra expression
A sequence of relational algebra operations on one or more relations that produces a new relation as a result
What are the groups of operations on relational algebra?
- Unary Relational Operation
- Relational Algebra Operations from Set Theory
- Binary Relational Operations
- Additional Relational Operations
Unary Relational Operations
- SELECT: σ
- PROJECT: π
- RENAME: ρ
Relational Algebra Operations Set Theory
- UNION: ∪
- INTERSECTION: ∩
- DIFFERENCE: -
- CARTESIAN PRODUCT: X
Binary Relational Operations
- JOIN:
- DIVISION:
Additional Relational Operations
- OUTER JOINS
- INNER JOINS
- AGGREGATE FUNCTIONS (SUM, COUNT, MIN ,MAX)
SELECT
σ dno=4(EMPLOYEE)
PROJECT OPERATION
This operation filter attributes from a relation. Keeps certain columns and discards others. It creates a vertical partitioning
πlname,fname,salary(EMPLOYEE)
Left arrow symbol
The assignment operation
DEPT5_EMPS < – σdno=5(EMPLOYEE)
RESULT < – πfname,Lname,salary(RESULT)
JOIN
Used to identify and select related tools from two relations
Join operation combines the relation R1 and R2 with respect to a condition. It is denoted by ⋈.
A complete set