ITPEC FE Morning April 2021 Question 28

Source exam: ITPEC FE Morning April 2021Topic: Databases

ITPEC FE Morning April 2021 — Question 28 of 80

Hash Index vs B+ Tree Index — choose the right index type for the query pattern.

Hash index supports only exact-match lookups (=). B+ tree index supports exact match, range queries, partial matches, and ordering.

Why (d) is correct:
- Searching by user ID = '1001' is a pure equality search → hash index is ideal

Why not others:
- (a) sales amount >= 100range search → requires B+ tree

- (b) product name beginning with 'DB' — prefix match (LIKE) → requires B+ tree

- (c) sales date in current month — range search (date range) → requires B+ tree

Key rule: Hash index → equality only (=). Any comparison, range, or pattern match → B+ tree.

AI-generated — may contain errors

The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.