Important MCQs:
What is the primary purpose of indexing in databases?
A) To increase the size of the database
B) To speed up access to desired data
C) To reduce redundancy
D) To enforce data integrity
Answer: B) To speed up access to desired data
Which of the following is a characteristic of a B+ tree?
A) All leaf nodes are at different levels
B) Non-leaf nodes do not store actual data
C) It allows duplicate keys
D) It is not balanced
Answer: B) Non-leaf nodes do not store actual data
In a dense index, how are index records stored?
A) For every search-key value in the file
B) For only some search-key values
C) Only for the primary key
D) Only for the foreign key
Answer: A) For every search-key value in the file
What is the main advantage of using a sparse index?
A) Faster access time
B) Less space and maintenance overhead
C) More accurate results
D) Easier to implement
Answer: B) Less space and maintenance overhead
Which indexing method is best suited for range queries?
A) Hash indexing
B) Ordered indexing
C) Sparse indexing
D) Bitmap indexing
Answer: B) Ordered indexing
Numerical Questions:
Given a B+ tree with a maximum of 6 children per node, calculate the maximum height
of the tree if it contains 1,000,000 search-key values.
Solution: The height of the tree is no more than ⌈log⌈6/2⌉(1,000,000)⌉. Calculate
this value to find the height.
If a hash table has 100 buckets and the load factor is 1.5, how many entries are
expected in the hash table?
Solution: Expected entries = Load factor × Number of buckets = 1.5 × 100 = 150
entries.
Theoretical Questions:
Explain the difference between a primary index and a secondary index. Provide
examples of each.
Discuss the advantages and disadvantages of using B+ trees for indexing in
databases.
What are the key features of bitmap indices, and in what scenarios are they most
effective?
Describe the process of insertion and deletion in a B+ tree. How does the tree
maintain its properties during these operations?
What is dynamic hashing, and how does it differ from static hashing? Discuss its
advantages in a database context.