Purpose of Project (Projection) in Relational Algebra and Databases

Purpose of Project (Projection) in Relational Algebra and Databases

Verified Sources
Sep 13, 2026

In relational algebra, the project (projection) operation keeps only the specified attributes/columns from a relation, forming a new relation with fewer columns. It does not filter rows (that is the select/selection operator) and it does not directly “select certain strings” or “certain integers” as types—rather, it selects columns by name, and the resulting tuples contain the values from those chosen columns. 2

Mermaid overview of how operators differ:

Key idea: projection changes the schema (columns) but not the tuple eligibility via predicates (row filtering is handled by selection). 2

Keyword concepts

  • [Projection]{def="Relational algebra operator that returns only selected attributes (columns)")}
  • [Selection]{def="Relational algebra operator that filters rows based on a predicate")}
  • [Attribute]{def="A named column of a relation")}
  • Tuple
  • Schema

Footnotes

  1. Wikipedia - Projection (relational algebra) https://en.wikipedia.org/wiki/Projection_(relational_algebra) - Defines projection π as selecting attributes/columns and notes duplicate elimination due to set semantics. 2

  2. Wikipedia - Relational algebra https://en.wikipedia.org/wiki/Relational_algebra - Describes operators including projection and selection, distinguishing row filtering from column reduction. 2

Relational Algebra: Projection vs Selection (Intro)

Answer to the multiple-choice question

Given the options:

(i) It selects certain columns.
(ii) It selects certain rows.
(iii) It selects certain strings.
(iv) It selects certain integers.

The correct purpose of project/ projection is:

(i) It selects certain columns. 2

Why the others are incorrect:

  • (ii) Selecting rows corresponds to selection (σ) with a predicate. 2
  • (iii) Selecting strings and (iv) Selecting integers are not the core definition. Projection is defined by selecting attributes (columns); any values (strings/integers/etc.) inside those columns are carried through unchanged (except duplicates may be removed). 2

Footnotes

  1. Wikipedia - Projection (relational algebra) https://en.wikipedia.org/wiki/Projection_(relational_algebra) - Defines projection π as selecting attributes/columns and notes duplicate elimination due to set semantics. 2 3

  2. Wikipedia - Relational algebra https://en.wikipedia.org/wiki/Relational_algebra - Describes operators including projection and selection, distinguishing row filtering from column reduction. 2 3

Formal definition (what projection produces)

In relational algebra, projection is commonly written as piA1,A2,...,Ak(R)\\pi_{A_1, A_2, ..., A_k}(R), meaning:

  • Start with relation RR
  • Keep only attributes A1,...,AkA_1, ..., A_k
  • The resulting relation has tuples that consist only of those attributes
  • The resulting relation removes duplicates (since relations are sets, not bags) 2

This means projection is primarily about schema projection:

  • input: R(A,B,C,...)R(A, B, C, ...)
  • output: piA,B(R)\\pi_{A,B}(R) has only attributes AA and BB 2

Mermaid schema change

Footnotes

  1. Wikipedia - Projection (relational algebra) https://en.wikipedia.org/wiki/Projection_(relational_algebra) - Defines projection π as selecting attributes/columns and notes duplicate elimination due to set semantics. 2

  2. Wikipedia - Relational algebra https://en.wikipedia.org/wiki/Relational_algebra - Describes operators including projection and selection, distinguishing row filtering from column reduction. 2

How projection works on a relation (π operator)

  1. 1
    Step 1

    Write πA1,A2,...,Ak\pi_{A_1, A_2, ..., A_k} to specify which columns to keep from the original relation.

  2. 2
    Step 2

    For each tuple in RR, form a new tuple containing only the values from the chosen attributes.

  3. 3
    Step 3

    Because projection returns a relation (set of tuples), any duplicate resulting tuples are removed.

  4. 4
    Step 4

    Output has the reduced schema (only the selected columns).

Pro Tip

If your question says “select certain rows,” think σ (selection). If it says “keep only some columns,” think π (projection).

Common confusion

Projection does not mean “filter by value type” (strings/integers). It selects attributes (columns). Any string/integer values inside those columns are preserved.

Projection vs Selection (quick comparison)

OperatorNotationWhat it filters/keepsTypical question phrase
Projectionpiattrs(R)\\pi_{attrs}(R)Keeps selected columns (attributes), removes duplicates“Select certain columns”
Selectionsigmapredicate(R)\\sigma_{predicate}(R)Keeps selected rows (tuples) satisfying a condition“Select certain rows”

These roles are standard distinctions in relational algebra: projection is attribute/column reduction; selection is predicate-based row filtering. 2

Keyword mapping

  • Projection
  • Selection
  • Duplicate elimination
  • Predicate
  • Attribute list

Footnotes

  1. Wikipedia - Projection (relational algebra) https://en.wikipedia.org/wiki/Projection_(relational_algebra) - Defines projection π as selecting attributes/columns and notes duplicate elimination due to set semantics.

  2. Wikipedia - Relational algebra https://en.wikipedia.org/wiki/Relational_algebra - Describes operators including projection and selection, distinguishing row filtering from column reduction.

Relational Algebra Workflow (typical query composition)

Selection (σ)

1. Filter rows

Apply predicates to restrict which tuples participate."

Projection (π)

2. Reduce columns

Keep only needed attributes, forming the final output schema."

Joins, union, difference

3. (Optional) Combine or transform

Use other operators depending on the query intent."

What Project (π) does vs Selection (σ)

Column vs row focus

Common edge questions

Knowledge Check

Question 1 of 4
Q1Single choice

In relational algebra, the project (projection) operator π primarily selects: