NAT · 2 marks · Relational Queries

GATE CS 2019 CS — Q55

Consider the following relations P(X, Y, Z), Q(X, Y, T) and R(Y, V).

P
XYZ
X1Y1Z1
X1Y1Z2
X2Y2Z2
X2Y4Z4
Q
XYT
X2Y12
X1Y25
X1Y16
X3Y31
R
YV
Y1V1
Y3V2
Y2V3
Y2V2
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))\prod_X \left(\sigma_{(P.Y = R.Y \land R.V = V2)}(P \times R)\right) - \prod_X \left(\sigma_{(Q.Y = R.Y \land Q.T > 2)}(Q \times R)\right)
Answer: __________.