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).)
- A. 833
- B. 1000
- C. 2500
- 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
- R(A, B, C, D, E, F, G) has the functional dependencies AB -> C, C -> D, D -> E, E -> C, F -> G, BG -> A and AE -> F. How many candidate…
- R(A, B, C, D, E) has the functional dependencies A -> B, BC -> D, D -> E and E -> B. The decomposition R1(A, B), R2(B, C, D), R3(A, D, E) is
- Transactions are T1: R(A) W(A) R(B); T2: W(A) R(B) W(B); T3: R(B) W(A) (each executes its operations in the order shown). Of all possible…
- Basic timestamp ordering assigns timestamps TS(T1) < TS(T2) < TS(T3) < TS(T4) = 1, 2, 3, 4. For a data item Q, R(Q) is rejected if TS(T) <…
- An extendible hash index has bucket capacity 2 and uses the low-order bits of the integer key as the hash value (the directory starts with…
- A file of 32,000 pages is sorted with an external merge sort using 32 buffer pages: pass 0 produces sorted runs of 32 pages, and every…