Selection (σ) is a relational‑algebra operation that filters rows from a relation based on a given condition. It is denoted by the Greek letter sigma (σ) and works like a WHERE clause in SQL.

In simple terms, the selection operation takes a relation and returns only those tuples (rows) that satisfy the specified condition, while keeping the original structure of the table.

Syntax and Meaning

The general syntax is:

σcondition(R)\sigma_{\text{condition}}(R)
  • RR: the input relation (table).

  • condition: a logical expression such as age > 25, salary ≤ 50000, or dept = 'HR'.

The result is a new relation with the same attributes as RR, but containing only the rows for which the condition evaluates to true.

Example for Clarity

Consider a relation EMPLOYEE(emp_id, name, age, salary, dept).

If we want all employees with salary greater than 50,000, we write:

σsalary>50000(EMPLOYEE)\sigma_{\text{salary} > 50000}(EMPLOYEE)

The output table will have the same columns (emp_id, name, age, salary, dept) but only the rows where salary > 50000.

Key Properties of Selection

  • Selection does not change the attributes; it only filters rows.

  • The number of attributes in the result is equal to the number in the original relation.

  • Selection is commutative: applying multiple selections in any order gives the same final result, for example,

    σA>5(σB<10(R))σB<10(σA>5(R))\sigma_{A > 5}(\sigma_{B < 10}(R)) \equiv \sigma_{B < 10}(\sigma_{A > 5}(R))

Why Selection Matters?

  • It is the basic mechanism for extracting specific rows that satisfy a given condition.

  • It forms the foundation for query processing and optimization in DBMS.

  • Understanding selection helps in writing efficient SQL WHERE clauses and interpreting how databases execute simple filters.

Selection is usually the first relational‑algebra operation students learn because it matches the intuitive idea of “finding rows that satisfy a condition” and is easy to represent mathematically and visually.