GATE CS 2019 · Question 65 · Databases · Numerical answer (NAT) · 2 marks · no negative marks

Consider the following relations P(X,Y,Z), Q(X,Y,T) and R(Y,V).
P
Q
R
How many tuples will be returned by the following relational algebra query?
Π_X(σ_((P.Y=R.Y ∧ R.V=V2))(P × R)) - Π_X(σ_((Q.Y=R.Y ∧ Q.T>2))(Q × R))
Answer: ______.

XYZ
X1Y1Z1
X1Y1Z2
X2Y2Z2
X2Y4Z4
XYT
X2Y12
X1Y25
X1Y16
X3Y31
YV
Y1V1
Y3V2
Y2V3
Y2V2
Answer

Answer 1

Answer from the official GATE CS 2019 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes