in my gate 2019 paper I have got table data bit different compared to this question. when I solved that question I have got answer as 1. for this particular question answer would be zero only. Please check below.
as operation ∧ is commutative, we better find out R.V=V2 first.σ(P.Y=R.Y ∧ R.V=V2)(P × R)
R.V=V2
σ(P.Y=R.Y ∧ R.V=V2)(P × R)
X |
Y |
Z |
V |
x2 |
y2 |
z2 |
v2 |
x2 |
y2 |
z4 |
v2 |
∏x(σ(P.Y=R.Y ∧ R.V=V2)(P × R))
so when we project column x from the above relation we get (i.e : as no relation should contain duplicate elements)
similarly for σ(Q.Y=R.Y ∧ Q.T>2)(Q × R) we get it as below.
Q.T>2
σ(Q.Y=R.Y ∧ Q.T>2)(Q × R)
X |
Y |
T |
V |
x1 |
y2 |
5 |
v3 |
x1 |
y2 |
5 |
v2 |
x2 |
y1 |
6 |
v1 |
when we project column x from the above relation we get
(i.e : as no relation should contain duplicate elements)
∏x(σ(P.Y=R.Y ∧ R.V=V2)(P × R)) - ∏x(σ(Q.Y=R.Y ∧ Q.T>2)(Q × R))
the final result is {x2} - {x1, x2} it should be nothing
so answer should be 0 for this question.