902 views

2 Answers

2 votes
2 votes
1
{x1}-{x2}
1 votes
1 votes

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

Y V
y3 v2
y2 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)

X
x2

similarly for σ(Q.Y=R.Y ∧ Q.T>2)(Q × R) we get it as below.

Q.T>2

X Y T
x1 y2 5
x2 y1 6

σ(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 

X
x1
x2

(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.

edited by

Related questions

0 votes
0 votes
2 answers
1
Manoj Kumar Pandey asked Feb 7, 2019
692 views
0 votes
0 votes
1 answer
2