Skip to content
Official PYQ · 2026

GATE CS 2026 Set 1 Q33 — Tuple Calculus and SQL

Explain with AI

Consider a relational database schema with two relations R(P,Q)R(P, Q) and S(X,Y)S(X, Y).

Let E={⟨u⟩∣∃v∃w⟨u,v⟩∈R∧⟨v,w⟩∈S}E=\{\langle u\rangle \mid \exists v \exists w\langle u, v\rangle \in R \wedge\langle v, w\rangle \in S\} be a tuple relational calculus expression.

Which one of the following relational algebraic expressions is equivalent to EE ?

Choose one option
View worked solution

Answer: B

To find the relational algebra expression equivalent to the given Tuple Relational Calculus (TRC) expression, let us analyze its components step-by-step.

1. Analyze the Relation Schemas

  • Relation R(P,Q)R(P, Q) has attributes PP (first position) and QQ (second position).
  • Relation S(X,Y)S(X, Y) has attributes XX (first position) and YY (second position).

2. Deconstruct the TRC Expression

The given TRC expression is:

E={⟨u⟩∣∃v∃w⟨u,v⟩∈R∧⟨v,w⟩∈S}E = \{\langle u\rangle \mid \exists v \exists w \langle u, v\rangle \in R \wedge \langle v, w\rangle \in S\}
  • First term: ⟨u,v⟩∈R\langle u, v\rangle \in R
    Since RR has attributes (P,Q)(P, Q), this implies: u=R.Pandv=R.Qu = R.P \quad \text{and} \quad v = R.Q
  • Second term: ⟨v,w⟩∈S\langle v, w\rangle \in S
    Since SS has attributes (X,Y)(X, Y), this implies: v=S.Xandw=S.Yv = S.X \quad \text{and} \quad w = S.Y

3. Establish the Equivalence

Since the variable vv represents both R.QR.Q and S.XS.X, we must equate them:

R.Q=S.XR.Q = S.X

The output tuple contains only ⟨u⟩\langle u\rangle, which corresponds to the attribute PP of relation RR. Therefore, we project only PP after performing a theta-join between RR and SS on the condition S.X=R.QS.X = R.Q:

ΠP(S⋈S.X=R.QR)\Pi_{P}\left(S \bowtie_{S.X = R.Q} R\right)

This matches Option B.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Tuple Calculus and SQL questions