CS FundamentalsHardGATE CS

R(A, B) has 5000 tuples with V(R, B) = 100 distinct B values. S(B, C) has 3000 tuples with V(S, B) = 300 and V(S, C) = 60. Using the uniformity and containment-of-value-sets assumptions, what is the estimated number of tuples of R JOIN σ(C = c)(S)? (After a selection the number of distinct B values in the result is min(V(S, B), result size).)

  1. A. 833
  2. B. 1000
  3. C. 2500
  4. D. 5000

Correct answer: C. 2500

σ(C = c)(S) has 3000/60 = 50 tuples, and V(S', B) = min(300, 50) = 50. The join size is |R| x |S'| / max(V(R, B), V(S', B)) = 5000 x 50 / 100 = 2500. Using the unselected V(S, B) = 300 gives 833.

More DBMS and SQL questions

Exams that ask this topic