Practice mode DBMS and SQL

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.