A relation r(A,B) in a relational database has 1200 tuples. The attribute A…
2021
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 ____________.
Attempted by 161 students.
Show answer & explanation
Correct answer: 820
Answer: 820 tuples
Reasoning (concise):
A has values 6..20 → 15 distinct values. B has values 1..20 → 20 distinct values.
P(A > 10) = 10/15 = 2/3 (values 11..20).
P(B = 18) = 1/20.
Assuming independence, P((A > 10) OR (B = 18)) = P(A > 10) + P(B = 18) − P(A > 10)·P(B = 18) = 2/3 + 1/20 − (2/3)(1/20) = 41/60.
Expected number of tuples = 1200 × 41/60 = 820.
Note: the provided answer value of 819 appears to be off by one; the exact calculation yields 820.
A video solution is available for this question — log in and enroll to watch it.