All mock tests are FREE till 31 December — register to save your progress
Unit 4 · Database Management Systems Paper 2 CS · 22 June 2026

Which of the following relational algebraic expressions is equivalent to the SQL query SELECT X FROM B WHERE Y ?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. πx(σy(B))

Explanation

The SQL query filters rows of B that satisfy condition Y (a selection on Y) and then returns only column X from the surviving rows (a projection onto X). In relational algebra this is written as the projection applied to the selection, i.e. πx(σy(B)), since the WHERE clause is always applied before the SELECT list restricts the output columns. The other options either apply projection before selection, or apply both operators on the same attribute, which does not correspond to this query.

More Database Management Systems questions