Indexing, Storage & Query Processing
. The source does not explicitly assume uniform distributions and its tuple count exceeds the distinct-pair domain size.](../../assets/questions/CS-2021-S1-Q33-1.webp)
Answer & solution
Official answer: 819 to 820 OR 205
Our answer: 820 under uniform bag estimation; official also accepts 205
Under uniform independent attribute estimates, P(A>10)=10/15 and P(B=18)=1/20. Inclusion-exclusion gives selection fraction 10/15+1/20−(10/15)(1/20)=41/60. Multiplying by 1200 gives 820. The official key also accepts 205, which is the number of distinct qualifying pairs in the full 15×20 value grid: 200 pairs with A>10 plus 5 additional pairs with B=18. Both official alternatives are preserved exactly. Premise issues: independence alone does not imply uniform marginals, and a mathematical set relation with only these two finite-domain attributes can have at most 300 distinct tuples, not 1200. The820 estimate therefore uses bag/count statistics and uniformity assumptions; 205 corresponds to the distinct-pair grid, not 1200 distinct source tuples.
There are 15 A-values and 20 B-values. Ten A-values (11 through 20) pass A>10, while one B-value passes B=18. The overlap must be subtracted because OR counts a tuple satisfying both only once. Under the full-grid model there are 10×20+15×1−10×1=205 qualifying pairs out of 300, so the selectivity is 205/300=41/60. Applying that fraction to the stated 1200 rows yields 820. These are distinct interpretations, not two different arithmetic roundings of one count.