CS FundamentalsHardGATE CS (PYQ pattern)
A B+ tree index is built on (a, b) in this order. For which of these predicates can a search descend directly to a contiguous range of entries that contains exactly the qualifying rows (no scanning of non-qualifying entries inside the range)? I. a = 5 AND b = 10 II. a = 5 AND b > 10 III. a > 5 AND b = 10 IV. b = 10
- A. I only
- B. I and II only
- C. I, II and III only
- D. II and IV only
Correct answer: B. I and II only
Entries are sorted by a, then b. A = with a = and a range on b is one contiguous run (I, II). With a > 5 the b values restart for each a, so b = 10 matches are scattered (III), and b alone has no leading column (IV).
More DBMS and SQL questions
- Which of the following relational-algebra identities are valid for union-compatible relations R and S? I. σ{A=1}(R ∪ S) = σ{A=1}(R) ∪…
- R(A, B) has 100 tuples; R.B is a foreign key to S(B), which is S's primary key, but R.B allows NULL and 10 tuples of R have B = NULL. S…
- Three transactions each run x = x + 10 as an unprotected read followed by a write of (value read + 10), on a shared x that starts at 0…
- R(A, B, C, D, E, F) has the functional dependencies B → E, F → A, BC → F, AF → D, C → B. What is the highest normal form of R (1NF, 2NF…
- R(A, B, C, D, E) has the functional dependencies D → C, DC → B, A → B, AC → E, C → A, E → C, D → E. How many of the listed dependencies…
- R(A, B, C, D, E, F) has the functional dependencies A -> B, DB -> F, FB -> C, A -> C, A -> D, EF -> B. An attribute set X is closed if X+…