Extended Relational Algebra increases power over basic relational algebra by adding new features and capabilities.
Normal Projection only projects specific columns from a relation.
Normal Projection only projects specific columns from a relation.
Generalized Projection extends this by allowing arithmetic operations on the projected columns.
Notation:
⇒ E is any relational-algebra expression.
⇒ Each F1, F2, ..., Fn is an arithmetic expression involving constants and attributes in the schema of E.
Ex:Aggregate Functions take a collection of values and return a single value as a result. Common aggregate functions include:
⇒ avg: Average value
⇒ min: Minimum value
⇒ max: Maximum value
⇒ sum: Sum of values
⇒ count: Number of values
⇒ These operations can be applied to the entire relation or to certain groups of tuples. They ignore NULL values, except for count.
Generalized Form (g) of Aggregate Operation:⇒ E is any relational-algebra expression.
⇒ G1, G2, ..., Gn is a list of attributes on which to group (can be empty).
⇒ Each Fi is an aggregate function.
⇒ Each Ai is an attribute name.
⇒ The result of aggregation does not have a name by default. Use the rename operation to give it a name.
⇒ For convenience, we permit renaming as part of the aggregate operation using the AS keyword.