search
Log In
1 vote
442 views

in Databases 442 views

2 Answers

2 votes
1
{x1}-{x2}
0
Plz explain I'm a bit confused for it to be 0
1
Part 1
required rows :
p.y=r.y and r.v=v2
so you get
x2 y2 v2

part 2
q.y=r.y and t>2
so you get
x1 y2 v3

these 2 sets don't have any common value of x
therefore you will get the cardinality of 1st
0
This was for how many marks?
1
2mrk
0
Manisha...r u sure..I also got x1 - x2..
1 vote

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
2 answers
1
327 views asked Feb 7, 2019 in Programming Manoj Kumar Pandey 327 views
0 votes
1 answer
2
787 views
Is the rank of 631/28326 a good rank? What college I must apply to? or any advice/suggestion will be helpful and r welcome. Marks – 61.67 Accuracy – 98%+ (Only 1 -ve in Tag bit question) Category – SC but ok with OPEN too. Thank You in Advance (^_^)
asked Feb 14, 2019 in IISc/IITs CarryGinati 787 views
...