The projection operation selects a subset of attribute from a relation and maps it to a new relation containing only those attributes, i.e.
Where is a new tuple containing only the values from the attribute specified in the list for a given tuple . Since the resulting relation is a set, any duplicate tuple that arise from this operation are automatically eliminated.
Note that there’s also the possibility for extended projection, meaning specifying expressions instead of attributes, i.e.:
The rename operation, denoted by , modifies the schema of a relation without altering the data within its tuples. It produces a new relation with either a new name for the relation itself or new names for its attributes. It is used in two primary forms:
Renaming a Relation
The expression renames the relation to . The new relation has the identical schema and contains the exact same set of tuples as .
Renaming Attributes
The expression produces a new relation where the attribute from is renamed to . This can be extended to rename multiple attributes at once, e.g., .
The values and the number of tuples remain unchanged, only the attribute names in the schema are modified.
The grouping and aggregation operation, denoted by , is an operator that first partitions tuples of a relation into groups and then computes a single or multiple summary value for each group using an aggregate function.
This process involves two main steps:
Grouping: Tuples that have the same values for all attributes in a specified grouping list are placed into the same group.
Aggregation: An aggregate function (like SUM, COUNT, AVG, MIN, MAX) is applied to an attribute of the tuples within each group, producing a single value per group.
where:
is the list of attributes to group by
is the aggregate function to be applied to each group. This also defines the new attribute for the aggregate value in the result schema (e.g., )
The natural join combines two relations via common attributes (same names and domains) by combining only tuples with the same values for common attributes.