1. SELECT (σ):
o What it does: The SELECT operation is used to filter rows (tuples) from a
relation (table) based on a specified condition. It essentially extracts a subset of
the rows that satisfy the given predicate. The result of a SELECT operation is a
new relation containing only the rows that meet the condition, while the columns
remain the same as in the original relation. Think of it like using a WHERE clause
in SQL.
o Relational Algebra Statement Example:
Assume we have a relation named Employees with attributes emp_id, first_name, last_name, and
department. To select only the employees who work in the 'Sales' department, the relational
algebra statement would be:
σ_{department = 'Sales'}(Employees)
This would result in a new relation containing only the rows from the Employees relation where
the value of the department attribute is 'Sales'.
2. PROJECT (Π):
o What it does: The PROJECT operation is used to choose specific columns
(attributes) from a relation, discarding the other columns. It creates a new relation
that contains only the specified attributes, in the order they are listed. Duplicate
rows might be removed from the resulting relation to maintain the set semantics
of relational algebra. Think of it like specifying the columns you want to see in a
SELECT statement in SQL.
This study source was downloaded by 100000898182462 from CourseHero.com on 05-03-2025 01:35:25 GMT -05:00
https://www.coursehero.com/file/248914813/Milestone-Activity-Relational-Algebradocx/
o What it does: The SELECT operation is used to filter rows (tuples) from a
relation (table) based on a specified condition. It essentially extracts a subset of
the rows that satisfy the given predicate. The result of a SELECT operation is a
new relation containing only the rows that meet the condition, while the columns
remain the same as in the original relation. Think of it like using a WHERE clause
in SQL.
o Relational Algebra Statement Example:
Assume we have a relation named Employees with attributes emp_id, first_name, last_name, and
department. To select only the employees who work in the 'Sales' department, the relational
algebra statement would be:
σ_{department = 'Sales'}(Employees)
This would result in a new relation containing only the rows from the Employees relation where
the value of the department attribute is 'Sales'.
2. PROJECT (Π):
o What it does: The PROJECT operation is used to choose specific columns
(attributes) from a relation, discarding the other columns. It creates a new relation
that contains only the specified attributes, in the order they are listed. Duplicate
rows might be removed from the resulting relation to maintain the set semantics
of relational algebra. Think of it like specifying the columns you want to see in a
SELECT statement in SQL.
This study source was downloaded by 100000898182462 from CourseHero.com on 05-03-2025 01:35:25 GMT -05:00
https://www.coursehero.com/file/248914813/Milestone-Activity-Relational-Algebradocx/