GATE DA 2026 · Tuple Calculus

NAT · 2 marks · Problem DBMS-RELM-0059

Let there be two relations \(X\) and \(Y\) as shown. \(X\) has three columns \(P, Q\) and \(R . Y\) has two columns \(P\) and \(S\). \(\textbf{X}\)\[\begin{array}{|c|c|c|} \hline P & Q & R \\ \hline P1 & Q1 & R1 \\ \hline P2 & Q2 & R2 \\ \hline P3 & Q3 & R2 \\ \hline \end{array}\]\(\textbf{Y}\)\[\begin{array}{|c|c|} \hline P & S \\ \hline P1 & 10 \\ \hline P1 & 15 \\ \hline P2 & 20 \\ \hline P3 & 1 \\ \hline \end{array}\]Consider that the following tuple relational calculus expression is evaluated.\(\{t \mid t \in X \wedge \exists z \in X(t[P]=z[P]) \wedge \exists m \in Y(m[P]=t[P] \wedge m[S]>1)\}\) The number of tuples that will be returned is . (Answer in integer )

Numerical answer (NAT).

Solve it on GATE DA practice →More Relational Model & SQL problems

Show the worked solutionSimplify the expression first: \(\exists z\in X(t[P]=z[P])\) is trivially always true for any \(t\in X\) (just take \(z=t\) itself) — it adds no real restriction. So the query reduces to: \(\{t\mid t\in X\wedge\exists m\in Y(m[P]=t[P]\wedge m[S]>1)\}\).\(X=\{(P1,Q1,R1),(P2,Q2,R2),(P3,Q3,R2)\}\), \(Y=\{(P1,10),(P1,15),(P2,20),(P3,1)\}\).Checking each \(t\in X\) for a matching \(m\in Y\) with \(m[S]>1\):• \(t=(P1,Q1,R1)\): \(Y\) has \(P1\) rows with \(S=10,15\) (both \(>1\)) — match, included.• \(t=(P2,Q2,R2)\): \(Y\) has \(P2\) row with \(S=20>1\) — match, included.• \(t=(P3,Q3,R2)\): \(Y\)'s only \(P3\) row has \(S=1\), which is not \(>1\) — no match, excluded.Answer: 2

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com