A row from a table is selected by: selection, projection, union, or none?
In relational algebra, selecting a subset of rows (tuples) from a table is done with the selection operator (sigma), while projection keeps the same rows but selects only certain columns (attributes). Union combines rows from two relations (tables) after they are union-compatible (same schema).3
Therefore, for the statement:
“A row from a table is selected by … (i) selection operator (ii) projection operator (iii) union operator (iv) none of these”
the correct choice is (i) selection operator. Because selection filters rows according to a predicate. 2
Key terms:
- Selection Operator
- Projection Operator
- Union Operator
- Predicate
Footnotes
-
GeeksforGeeks — Introduction to Relational Algebra in DBMS - Defines selection as filtering tuples (rows) and distinguishes it from projection. ↩ ↩2
-
Wikipedia — Projection (relational algebra) - Defines projection as restricting tuples to a subset of attributes (discarding other attributes). ↩
-
CSCI 4380 Database Systems Notes (RPI) — Relational Model and Algebra - Defines union as combining tuples from union-compatible relations. ↩
-
Relational Algebra (UMD CMSC424 PDF) - Gives formal definition/notation for selection operator σp(r). ↩
Relational Algebra: Selection vs Projection vs Union (overview)
How to determine which operator selects a row
- 1Step 1
“Select a row” means filtering tuples based on a condition—this corresponds to selection (σ), not projection (π).
- 2Step 2
Selection takes one relation and returns the subset of tuples that satisfy a predicate: .2
Footnotes
-
GeeksforGeeks — Introduction to Relational Algebra in DBMS - Defines selection as filtering tuples (rows) and distinguishes it from projection. ↩
-
Relational Algebra (UMD CMSC424 PDF) - Gives formal definition/notation for selection operator σp(r). ↩
-
- 3Step 3
Projection chooses columns/attributes and may remove duplicates; it does not filter tuples by a condition.2
Footnotes
-
Wikipedia — Projection (relational algebra) - Defines projection as restricting tuples to a subset of attributes (discarding other attributes). ↩
-
IBM Informix Documentation — Selection and projection - Selection is horizontal subset of rows; projection is vertical subset of columns retaining all rows. ↩
-
- 4Step 4
Union combines tuples from two relations; it does not “pick rows by condition” from one table.2
Footnotes
-
CSCI 4380 Database Systems Notes (RPI) — Relational Model and Algebra - Defines union as combining tuples from union-compatible relations. ↩
-
jcsites.juniata.edu — Relational Algebra - Describes union semantics as keeping rows from either relation; notes union compatibility. ↩
-
- 5Step 5
Since only selection filters rows, the correct option is (i) selection operator.2
Footnotes
-
GeeksforGeeks — Introduction to Relational Algebra in DBMS - Defines selection as filtering tuples (rows) and distinguishes it from projection. ↩
-
Relational Algebra (UMD CMSC424 PDF) - Gives formal definition/notation for selection operator σp(r). ↩
-
Operator comparison focused on rows vs columns
| Operator | What it selects | Input | Output |
|---|---|---|---|
| (selection) | Rows (tuples) matching a predicate | One relation | Same attributes, fewer tuples |
| (projection) | Columns (attributes) (subset) | One relation | Fewer attributes, all tuples (duplicates may be removed) |
| (union) | Rows from either of two relations | Two union-compatible relations | Combined tuples (duplicates removed) |
Supporting facts:
- Selection is defined as taking a subset of rows that satisfy a condition.2
- Projection discards other attributes; it is vertical filtering of columns.2
- Union combines two union-compatible relations (same attributes) into one set of tuples.2
Selection Operator Projection Operator Union Operator Union-compatible
Footnotes
-
GeeksforGeeks — Introduction to Relational Algebra in DBMS - Defines selection as filtering tuples (rows) and distinguishes it from projection. ↩
-
GeeksforGeeks — Difference between Selection and Projection in DBMS - States selection filters rows; projection selects columns. ↩
-
Wikipedia — Projection (relational algebra) - Defines projection as restricting tuples to a subset of attributes (discarding other attributes). ↩
-
IBM Informix Documentation — Selection and projection - Selection is horizontal subset of rows; projection is vertical subset of columns retaining all rows. ↩
-
CSCI 4380 Database Systems Notes (RPI) — Relational Model and Algebra - Defines union as combining tuples from union-compatible relations. ↩
-
jcsites.juniata.edu — Relational Algebra - Describes union semantics as keeping rows from either relation; notes union compatibility. ↩
Common confusions (exam-focused)
Pro Tip: Use a row/column mnemonic
If the question says row selection → think selection (σ) (horizontal filtering). If it says column selection → think projection (π) (vertical filtering).
Beware: “UNION” doesn’t mean “filter by condition”
Union (∪) is a set-combining operator for two (union-compatible) relations; it’s not the operator that chooses qualifying rows from a single table.
Operator effect on rows vs columns
Selection filters rows; projection filters columns; union merges rows from two tables.
Typical RA query workflow (row selection then column selection)
Selection (σ)
1) Filter rowsApply the predicate to reduce the relation to qualifying tuples."
Projection (π)
2) Choose columnsKeep only the required attributes from the filtered tuples."
Union (∪)
3) Combine results (optional)Merge tuples from multiple relations if needed, provided schemas match."
Knowledge Check
In relational algebra, filtering a table to keep only rows that satisfy a condition is done by: