GATE | GATE CS 2021 | Set 1 | Question 33
A relation r(A,B) in a relational database has 1200 tuples. The attribute A has integer values ranging from 6 to 20, and the attribute B has integer values ranging from 1 to 20. Assume that the attributes A and B are independently distributed.
The estimated number of tuples in the output of σ(A>10)∨(B=18)(r) is ____________.
(A) 820
(B) 1200
(C) 960
(D) 1000
Answer: (A)
Explanation: Probability of first condition satisfies, P(A) = 10/15
Probability of second condition satisfies, P(B) = 1/20
Probability of both condition satisfy, P(A∩B) = 10/15*1/20
Because of independent.
So, either first or second condition satisfy P(A∪B)
= P(A) + P(B) – P(A∩B)
= 10/15 + 1/20 – 10/15*1/20
= 0.6833
Therefore, estimated number of tuples in the output,
= 1200*0.6833
= 820
Quiz of this Question