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: ______.
| X | Y | Z |
|---|---|---|
| X1 | Y1 | Z1 |
| X1 | Y1 | Z2 |
| X2 | Y2 | Z2 |
| X2 | Y4 | Z4 |
| X | Y | T |
|---|---|---|
| X2 | Y1 | 2 |
| X1 | Y2 | 5 |
| X1 | Y1 | 6 |
| X3 | Y3 | 1 |
| Y | V |
|---|---|
| Y1 | V1 |
| Y3 | V2 |
| Y2 | V3 |
| Y2 | V2 |
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