Computer Sciences > GATE 2026 SET-1 > Relational Algebra
Consider a relational database schema with two relations R(P, Q) and S(X, Y).

Let E = {⟨u⟩ | ∃v ∃w ⟨u, v⟩ ∈ R ∧ ⟨v, w⟩ ∈ S} be a tuple relational calculus expression.

Which one of the following relational algebraic expressions is equivalent to E?
A
ΠP(R ⋈R.P=S.X S)
B
ΠP(S ⋈S.X=R.Q R)
C
ΠP(R ⋈R.P=S.Y S)
D
ΠP(S ⋈S.Y=R.Q R)

Correct : b

The tuple relational calculus expression E = {⟨u⟩ | ∃v ∃w ⟨u, v⟩ ∈ R ∧ ⟨v, w⟩ ∈ S} says: find all values u such that there exists a value v where the pair (u, v) appears in R, and that same v along with some w appears in S.
Reading this carefully — u maps to R.P, v maps to R.Q (from the first condition), and v also maps to S.X (from the second condition). So the link between R and S is that R.Q must equal S.X. The output is only u, which is R.P. This gives the relational algebra expression ΠP(R ⋈R.Q=S.X S).
Option A uses the join condition R.P = S.X which is wrong — R.P is what we output, not what we join on. Option C joins on R.P = S.Y which is also wrong on both attribute sides. Option D joins on S.Y = R.Q which uses the wrong S attribute — it should be S.X not S.Y. Option B joins on S.X = R.Q which is exactly the correct condition, and projects onto P from R. Writing the relations in different order inside the join does not change the result since natural join is commutative.
Correct answer: B ✓

Similar Questions

Consider a database that has the relation schemas EMP (EmpId, EmpName, DepId), and DEPT(DeptName, DeptId). Note that the DepId can be permitted to be NULL in th...
#198 MCQ
Consider the following two relations, R(A,B) and S(A,C); The total number of tuples obtained by evaluating the following expression σB<C(R ⨝R.A=S.AS) is...
#871 Fill in the Blanks
The relation schema, Person(pid, city), describes the city of residence for every person uniquely identified by pid. The following relational algebra operators...
#930 MCQ

Related Topics

tuple relational calculus relational algebra GATE 2026 GATE CS 2026 Set-1 Q48 TRC to relational algebra conversion GATE R(P Q) S(X Y) join projection GATE existential quantifier TRC GATE DBMS relational algebra GATE 2026

Unique Visitor Count

Total Unique Visitors

Loading......