CS FundamentalsVery hardGATE CS · TCS Digital
Relation R has 1,000 tuples with 100 distinct values of attribute A, and S has 500 tuples with 50 distinct values of A, all of which appear in R. Using the standard uniform-distribution estimate, how many tuples does R JOIN S on A produce?
- A. 500
- B. 1000
- C. 5000
- D. 10000
Correct answer: C. 5000
Estimated size = (|R| x |S|) / max(V(R,A), V(S,A)) = 500,000 / 100 = 5,000.
More DBMS and SQL questions
- A B+ tree is built so that every node is completely full: a leaf holds 100 keys and an internal node has 101 children. It indexes…
- R(A, B, C, D, E) has the functional dependencies AB -> C, C -> D, D -> E and E -> A. How many candidate keys does R have?
- Consider the schedule R1(A), W2(A), W1(A), W3(A). Which statement is correct?
- W(d, x) holds (1, 10), (2, 20), (2, 30), (3, 40). What value does SUM(x) OVER (ORDER BY d) give on the row (2, 20)?
- Under the SQL standard's isolation levels, which anomaly can still occur at REPEATABLE READ but is prevented at SERIALIZABLE?
- Which pair of properties must every primary key satisfy?