CS FundamentalsHardGATE CS (PYQ pattern)
R(A, B) has 10,000 tuples with V(R, B) = 200; S(B, C) has 5,000 tuples with V(S, B) = 500 and V(S, C) = 100; T(C, D) has 2,000 tuples with V(T, C) = 400. Using the standard estimate |X join Y| = |X| |Y| / max(V(X, a), V(Y, a)) on the join attribute a, and assuming the C-values of an intermediate result keep their count from S, what is the estimated size of (R join S) join T?
- A. 2,000,000
- B. 100,000
- C. 250,000
- D. 500,000
Correct answer: D. 500,000
|R join S| = 10,000 x 5,000 / max(200, 500) = 100,000, which keeps V(C) = 100. Then 100,000 x 2,000 / max(100, 400) = 500,000. Dividing by the smaller count (100) gives 2,000,000; stopping after the first join gives 100,000.
More DBMS and SQL questions
- An extendible hash index uses the LOW-order bits of the hash value, with bucket capacity 2 and an initial directory of global depth 1 (two…
- A file of 100,000 records of 120 bytes is stored in 4096-byte blocks, each with an 8-byte header (records do not span blocks), sorted on…
- R(A, B, C, D, E) has the functional dependencies DB → A, A → C, D → C, C → B. R is decomposed and one fragment is R1(A, C, D). Counting…
- R(A, B, C, D, E) has FDs A → B, BC → D, D → E, E → B. Which of the following are implied? I. AC → D II. A → E III. AC → E IV. D → B V. CD…
- R(A, B, C, D, E, F) has the functional dependencies B → C, FE → D, EF → B, E → A, CF → E. How many attributes of R are prime (belong to at…
- F = {A→B, B→C, AC→D, D→A} on R(A, B, C, D). Which of the following FD sets is equivalent to F (has exactly the same closure)?