Understanding B-Tree and Hash Indexes in Databases
Explore the differences and use-cases of B-Tree and Hash Indexes in databases.
Questions in this quiz
15 questions on Understanding B-Tree and Hash Indexes in Databases. Work through them here, then start the quiz to answer them and see your score.
1.What is the primary purpose of using an index in a database?
- ATo speed up data retrieval
- BTo ensure data integrity
- CTo increase data storage capacity
- DTo secure data
2.Which type of index is generally more efficient for range queries?
- AFull-text Index
- BHash Index
- CBitmap Index
- DB-Tree Index
3.Which index type is typically faster for exact match queries?
- AHash Index
- BBitmap Index
- CClustered Index
- DB-Tree Index
4.In which scenario would a B-Tree index be preferred over a Hash index?
- ARange queries
- BData encryption
- CExact match queries
- DSingle value lookups
5.What is a potential downside of using a Hash index?
- ASlower for exact matches
- BComplex to implement
- CInefficient for range queries
- DConsumes more disk space
6.Which index type is generally used by default in most relational databases?
- AFull-text Index
- BBitmap Index
- CB-Tree Index
- DHash Index
7.Why might a database use a B-Tree index for a primary key?
- ATo improve security
- BTo ensure fast range queries
- CTo allow duplicate values
- DTo reduce storage size
8.Which index type is more likely to be used for a column with high cardinality?
- ASpatial Index
- BB-Tree Index
- CBitmap Index
- DHash Index
9.What is a characteristic of a Hash index?
- AConsumes less memory
- BEfficient for range queries
- CMaintains sorted order
- DUses hash functions
10.Which type of index is generally not suitable for wildcard searches?
- ASpatial Index
- BFull-text Index
- CB-Tree Index
- DHash Index
11.What happens when a B-Tree index is updated?
- AThe entire index is rebuilt
- BOnly affected nodes are updated
- CData is duplicated
- DThe index becomes invalid
12.Which index type is more suitable for equality comparisons?
- AClustered Index
- BBitmap Index
- CB-Tree Index
- DHash Index
13.What is a common use-case for a Hash index?
- AGeospatial queries
- BRange queries
- CFull-text search
- DExact match lookups
14.Which index type can degrade in performance with a high number of duplicate values?
- AHash Index
- BBitmap Index
- CFull-text Index
- DB-Tree Index
15.What is an advantage of using a B-Tree index?
- ASupports range queries
- BConsumes less memory
- CFaster for exact matches
- DSimpler to implement