Relational Algebra

Relational algebra

SQL which is declarative is transformed into relational algebra which is procedural. Relational Algebra is further optimized, which is possible with SQL due to its declarative nature.

Screenshot from 2023-04-09 10-46-40.png

Aggregation

Screenshot from 2023-04-09 11-19-28.png

Outer joins

To be covered.

Screenshot from 2023-03-12 15-25-27.png

Screenshot from 2023-03-12 15-27-28.png

Query execution

After running the query these are the steps the DBMS takes:

Codd’s Theorem

Rel Algebra is a variable-free language, while tuple calculus is a logical language with variables and quantification, the theorem closes the gap and allows for translation.

Relational completeness

Querry languages that are equivalent in expressive power to Rel. Algebra are called relationally complete.

Query optimizer

Screenshot from 2023-04-09 11-34-29.png