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.

Aggregation
- without grouping the whole input is threated as one group
- example with grouping on the student attribute:

Outer joins
To be covered.


Query execution
After running the query these are the steps the DBMS takes:
- tokenize the query
- check syntax and verify relations(throws errors if not executable)
- translate into relational algebra(Codd’s Theorem)
- Query optimization - determines the operator tree
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
