A column has a hash index and a B-tree index available. Which query condition can use the B-tree index but not the hash index?
Correct answer B. WHERE salary BETWEEN 3000 AND 5000
Explanation
A hash index scatters keys by their hash values, so it can only answer equality lookups. A B-tree keeps keys in sorted order, so it also supports range conditions such as , <= and BETWEEN, as well as ORDER BY. The three equality conditions could use either index; the BETWEEN range needs ordered keys, which only the B-tree provides.
Answer checked How we write and check questions
Discussion