CS FundamentalsHardGATE CS
R has 2000 tuples and S has 5000 tuples. The join attribute A has 50 distinct values in R and 200 in S. Under the usual uniformity and containment assumptions, what is the estimated size of R ⋈ S?
- A. 200,000
- B. 10,000
- C. 50,000
- D. 40,000
Correct answer: C. 50,000
The estimate is |R| × |S| / max(V(A, R), V(A, S)) = 2000 × 5000 / 200 = 50,000. Dividing by the smaller count (50) overestimates it as 200,000.
More DBMS and SQL questions
- R(S, C) = {(1, a), (1, b), (2, a), (3, a), (3, b), (3, c), (4, b)}. What is R ÷ πC(σ{S = 1}(R))?
- An ER diagram has entity Employee (key eid, composite attribute name, multivalued attribute phone), weak entity Dependent (partial key…
- A ternary relationship Supplies links Supplier, Part and Project, and the rule is: for a given project and part there is at most one…
- The system crashes after the last record of this log (immediate modification; <Ti, X, old, new>; at the checkpoint all dirty pages were…
- A buffer manager uses NO-STEAL (pages with uncommitted changes are never written to disk) and FORCE (all pages a transaction changed are…
- T1 reads the balance of account 7, then T2 updates that same row and commits, then T1 reads the row again and sees a different value. No…