Relational Algebra: Using PROJECTION to Select Only Certain Columns

Relational Algebra: Using PROJECTION to Select Only Certain Columns

Verified Sources
Nov 4, 2026

In relational algebra, the operation used when you are interested in only certain columns (attributes) of a table is PROJECTION (option (i)).

A common way to remember this is:

  • SELECTION keeps all columns but selects rows that satisfy a condition.
  • PROJECTION keeps only specified columns (attributes) but selects all rows’ values for those columns.
  • UNION combines results of two relations with the same schema, not columns-selection.
  • JOIN combines two tables based on related rows (not “pick columns from one table” by itself).

Footnotes

  1. (Encyclopedia of Database Systems / relational algebra concept; projection definition) - https://en.wikipedia.org/wiki/Relational_algebra - Projection returns specified columns (attributes). ↩ ↩2

  2. https://en.wikipedia.org/wiki/Relational_algebra - Selection filters tuples (rows) by a predicate. ↩

  3. https://en.wikipedia.org/wiki/Relational_algebra - Union combines tuples from two relations with compatible schemas. ↩

  4. https://en.wikipedia.org/wiki/Relational_algebra - Join combines tuples from two relations based on a condition. ↩

Relational Algebra (Projection, Selection, Join) - Educational Overview

Mapping each option to its purpose

Below is a direct conceptual match to the question (“only certain columns”):

OptionOperationTypical intentMatches “only certain columns”?
(i)PROJECTIONchoose specific attributes (columns)✅ Yes
(ii)SELECTIONchoose specific tuples (rows) by condition❌ No
(iii)UNIONcombine two relations’ tuples (compatible schema)❌ No
(iv)JOINcombine tuples from two relations by a condition❌ No

Key idea: Projection is the column-pruning operator in relational algebra.

Footnotes

  1. (Encyclopedia of Database Systems / relational algebra concept; projection definition) - https://en.wikipedia.org/wiki/Relational_algebra - Projection returns specified columns (attributes). ↩

How to decide which relational algebra operator to use

  1. 1
    Step 1

    If the question says “only certain columns / attributes,” you should think PROJECTION. If it says “rows satisfying a condition,” think SELECTION.

  2. 2
    Step 2

    “Only certain columns” → PROJECTION; “where/condition” → SELECTION.

  3. 3
    Step 3

    If the task is about combining multiple tables, consider JOIN. If it’s about combining results from two compatible relations, consider UNION.

Pro Tip

"A fast memory trick: SELECTION = selection of rows, PROJECTION = projection of columns."2

Footnotes

  1. (Encyclopedia of Database Systems / relational algebra concept; projection definition) - https://en.wikipedia.org/wiki/Relational_algebra - Projection returns specified columns (attributes). ↩

  2. https://en.wikipedia.org/wiki/Relational_algebra - Selection filters tuples (rows) by a predicate. ↩

Common confusion

"Students often mix up SELECTION and PROJECTION: selection filters rows (keeps schema), while projection reduces the schema by keeping only chosen columns. They are different operators."2

Footnotes

  1. (Encyclopedia of Database Systems / relational algebra concept; projection definition) - https://en.wikipedia.org/wiki/Relational_algebra - Projection returns specified columns (attributes). ↩

  2. https://en.wikipedia.org/wiki/Relational_algebra - Selection filters tuples (rows) by a predicate. ↩

Mini examples (conceptual)

Let R(A,B,C)R(A, B, C) be a relation.

  • Projection onto AA and CC (columns only) returns a relation with schema (A,C)(A, C).
  • Selection with predicate (e.g., B=10B = 10) returns tuples that satisfy the predicate but keeps schema (A,B,C)(A, B, C).
    These behaviors are standard definitions of projection vs. selection in relational algebra.2

Footnotes

  1. (Encyclopedia of Database Systems / relational algebra concept; projection definition) - https://en.wikipedia.org/wiki/Relational_algebra - Projection returns specified columns (attributes). ↩

  2. https://en.wikipedia.org/wiki/Relational_algebra - Selection filters tuples (rows) by a predicate. ↩

Operator selection reasoning (from question to operator)

Read the prompt carefully

Step 1

Look for language like “only certain columns/attributes” or “rows that satisfy…”"

Choose by target

Step 2

Columns → PROJECTION; Rows → SELECTION"

Sanity-check against UNION/JOIN

Step 3

If nothing mentions combining two relations, UNION/JOIN usually do not fit."

Quick FAQ

Knowledge Check

Question 1 of 4
Q1Single choice

Which relational algebra operation is used when we are interested in only certain columns of a table?