We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Selection: The selection operator is denoted by the sigma (σ) symbol. It is used to retrieve tuples from a relation that satisfy specific conditions or predicates. For example, σ(age > 30)(Employees) selects all employees from the "Employees" relation whose age is greater than 30.
Projection: The projection operator is denoted by the pi (π) symbol. It is used to extract specific attributes or columns from a relation while discarding the rest. For example, π(name, age)(Employees) retrieves only the "name" and "age" attributes from the "Employees" relation.
Union: The union operator (∪) combines tuples from two relations, eliminating duplicates, to create a new relation. It requires both relations to have the same attributes. For example, R ∪ S combines the tuples from relations R and S to create a new relation.
Intersection: The intersection operator (∩) returns the common tuples between two relations, creating a new relation. Like the union operator, it requires both relations to have the same attributes. For example, R ∩ S retrieves the tuples that are common to both relations R and S.
Difference: The difference operator (-) returns the tuples from one relation that are not present in another relation, creating a new relation. It requires both relations to have the same attributes. For example, R - S retrieves the tuples from relation R that are not found in relation S.
Join: The join operator (⨝) combines tuples from two relations based on a common attribute, creating a new relation. There are different types of joins, including inner join, left join, right join, and full outer join, depending on how the tuples are matched. For example, R ⨝ S combines tuples from relations R and S based on a common attribute.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Relational Algebra - 4
You are viewing a single comment's thread. Return to all comments →
Selection: The selection operator is denoted by the sigma (σ) symbol. It is used to retrieve tuples from a relation that satisfy specific conditions or predicates. For example, σ(age > 30)(Employees) selects all employees from the "Employees" relation whose age is greater than 30.
Projection: The projection operator is denoted by the pi (π) symbol. It is used to extract specific attributes or columns from a relation while discarding the rest. For example, π(name, age)(Employees) retrieves only the "name" and "age" attributes from the "Employees" relation.
Union: The union operator (∪) combines tuples from two relations, eliminating duplicates, to create a new relation. It requires both relations to have the same attributes. For example, R ∪ S combines the tuples from relations R and S to create a new relation.
Intersection: The intersection operator (∩) returns the common tuples between two relations, creating a new relation. Like the union operator, it requires both relations to have the same attributes. For example, R ∩ S retrieves the tuples that are common to both relations R and S.
Difference: The difference operator (-) returns the tuples from one relation that are not present in another relation, creating a new relation. It requires both relations to have the same attributes. For example, R - S retrieves the tuples from relation R that are not found in relation S.
Join: The join operator (⨝) combines tuples from two relations based on a common attribute, creating a new relation. There are different types of joins, including inner join, left join, right join, and full outer join, depending on how the tuples are matched. For example, R ⨝ S combines tuples from relations R and S based on a common attribute.