Q1GATE 2026MCQ
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 ?
📖 Explanation
To convert the Tuple Relational Calculus (TRC) expression to Relational Algebra, let's analyze the given expression step-by-step:
E={⟨u⟩∣∃v ∃w ⟨u,v⟩∈R ∧ ⟨v,w⟩∈S}
-
Analyze the conditions on relations:
- The condition ⟨u,v⟩∈R for a relation R(P,Q) means the tuple variables u and v correspond to the attributes P and Q. Thus, u=R.P and v=R.Q.
- The condition ⟨v,w⟩∈S for a relation S(X,Y) means v and w correspond to attributes X and Y. Thus, v=S.X and w=S.Y.
-
Determine the Join Condition:
- The existential quantifiers (∃v,∃w) and the logical AND (∧) indicate a
JOINoperation is needed to find tuples that satisfy both conditions simultaneously. - The variable v is common to both conditions. From our analysis, v=R.Q and v=S.X. This establishes the join condition: R.Q=S.X.
- The existential quantifiers (∃v,∃w) and the logical AND (∧) indicate a
-
Determine the Projection:
- The TRC expression is of the form {⟨u⟩∣...}, which means we want to select only the values of u in the final output.
- Since we found that u=R.P, this corresponds to a
PROJECTIONon attribute P in Relational Algebra, denoted as ΠP.
-
Form the Relational Algebra Expression:
- Combining the join and projection, we first join relations R and S on the condition R.Q=S.X and then project the attribute P.
- The equivalent expression is: ΠP(R⋈R.Q=S.XS).
-
Compare with the given options:
- A. ΠP(R⋈R.P=S.XS): The join condition R.P=S.X is incorrect.
- B. ΠP(S⋈S.X=R.QR): The join operation is commutative, so S⋈S.X=R.QR is the same as R⋈R.Q=S.XS. The projection is on P. This expression is equivalent to our derived expression.
- C. ΠP(R⋈R.P=S.YS): The join condition R.P=S.Y is incorrect.
- D. ΠP(S⋈S.Y=R.QR): The join condition S.Y=R.Q is incorrect.


