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 ____________.
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
Therefore, estimated number of tuples in the output,
Quiz of this Question