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 and uniformly distributed. The estimated number of tuples in the output of σ(A>10 ∨ B=18)(r) is ____.
Explanation
P(A>10): 10 of the 15 possible values (11-20) satisfy this, so 2/3. P(B=18): 1 of 20 values, so 1/20. By inclusion-exclusion (independence assumed): P(A>10 ∨ B=18) = 2/3 + 1/20 − (2/3)(1/20) = 40/60+3/60−2/60 = 41/60. Estimated tuples = 1200×41/60 = 820.
Source: GATE CS 2021 (Session 1 / Set-1) (2021)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.