WikiGalaxy

Personalize

Selection (σ)

Definition:

Selection is a unary operation that selects tuples that satisfy a given predicate from a relation. It's denoted by σ.

Example Use Case:

Extracting records of employees who earn more than $50,000.


σ(salary > 50000)(Employee)
    

Result:

A subset of the Employee relation containing only those tuples where the salary is greater than 50,000.

Projection (π)

Definition:

Projection is a unary operation that extracts certain columns from a relation. It's denoted by π.

Example Use Case:

Retrieving only the names and salaries of employees.


π(name, salary)(Employee)
    

Result:

A new relation consisting of only the name and salary attributes of the Employee table.

Union (∪)

Definition:

Union is a binary operation that combines the tuples of two relations and removes duplicates. It's denoted by ∪.

Example Use Case:

Combining two sets of employee records from different departments.


Employee ∪ Manager
    

Result:

A relation containing all unique employee and manager records.

Set Difference (-)

Definition:

Set Difference is a binary operation that finds tuples present in one relation but not in another. It's denoted by -.

Example Use Case:

Identifying employees who are not managers.


Employee - Manager
    

Result:

A relation containing employees who do not appear in the Manager relation.

Cartesian Product (×)

Definition:

The Cartesian Product is a binary operation that returns a relation with all possible combinations of tuples from two relations. It's denoted by ×.

Example Use Case:

Generating all possible pairs of employees and departments.


Employee × Department
    

Result:

A relation containing all combinations of employee and department tuples.

Rename (ρ)

Definition:

Rename is a unary operation used to rename the output relation or its attributes. It's denoted by ρ.

Example Use Case:

Renaming the Employee relation to Staff.


ρ(Staff, Employee)
    

Result:

A relation identical to Employee but named Staff.

Join (⨝)

Definition:

Join is a binary operation that combines related tuples from two relations based on a common attribute. It's denoted by ⨝.

Example Use Case:

Linking employees with their respective departments.


Employee ⨝ Department
    

Result:

A relation containing tuples of employees linked with their departments.

Intersection (∩)

Definition:

Intersection is a binary operation that returns tuples present in both relations. It's denoted by ∩.

Example Use Case:

Finding employees who are also managers.


Employee ∩ Manager
    

Result:

A relation containing tuples that are common to both Employee and Manager relations.

logo of wikigalaxy

Newsletter

Subscribe to our newsletter for weekly updates and promotions.

Privacy Policy

 • 

Terms of Service

Copyright © WikiGalaxy 2025