Indexing (B-trees, hash indexing) MCQs in DBMS

By: Prof. Dr. Fazal Rehman Shamil | Last updated: September 23, 2024

MCQs on Indexing (B-trees, Hash Indexing) in DBMS

  1. What is the primary purpose of using B-trees in indexing?A. To store data sequentially
    B. To maintain sorted data and allow searches, insertions, deletions in logarithmic time
    C. To provide direct access to records
    D. To minimize disk space usage
    Answer: B. To maintain sorted data and allow searches, insertions, deletions in logarithmic time
  2. In a B-tree of order m, what is the maximum number of children a node can have?A. m-1
    B. m
    C. m+1
    D. 2m
    Answer: B. m
  3. Which property is unique to B+ trees compared to B-trees?A. All values are stored at leaf nodes and internal nodes store only keys
    B. Values can be stored at both internal and leaf nodes
    C. Nodes can have a variable number of children
    D. Leaf nodes are linked together to form a linked list
    Answer: A. All values are stored at leaf nodes and internal nodes store only keys
  4. What is a major advantage of using a B+ tree over a B-tree for indexing?A. Faster insertions and deletions
    B. Sequential access to records is easier
    C. Better handling of duplicate keys
    D. Requires less memory
    Answer: B. Sequential access to records is easier
  5. In a hash index, what is the purpose of a hash function?A. To sort the keys
    B. To encrypt the data
    C. To compute the address of the data record
    D. To compress the data
    Answer: C. To compute the address of the data record
  6. Which of the following is a disadvantage of hash indexing?A. Inefficient for range queries
    B. Slow search performance
    C. High memory usage
    D. Complexity in implementation
    Answer: A. Inefficient for range queries
  7. In B-trees, what happens when a node becomes full and a new key is inserted?A. The node is split into two nodes
    B. The new key is discarded
    C. The tree is rebalanced
    D. The node is expanded to accommodate the new key
    Answer: A. The node is split into two nodes
  8. What is the height of a B-tree with ‘n’ keys and minimum degree ‘t’?A. log_t(n)
    B. log_t(n+1)
    C. log_t((n+1)/2)
    D. log_t((n-1)/2)
    Answer: C. log_t((n+1)/2)
  9. Which type of index is more efficient for exact-match queries?A. B-tree index
    B. B+ tree index
    C. Hash index
    D. Dense index
    Answer: C. Hash index
  10. How does a B+ tree handle insertions when the leaf node is full?A. By creating a new tree
    B. By splitting the leaf node and adjusting the parent node
    C. By shifting the existing keys
    D. By merging with an adjacent node
    Answer: B. By splitting the leaf node and adjusting the parent node
  11. In a hash table, what is a ‘collision’?A. When two keys generate the same hash value
    B. When a key is not found
    C. When the table is resized
    D. When a key is deleted
    Answer: A. When two keys generate the same hash value
  12. Which of the following statements is true about B+ trees?A. They allow binary search
    B. They do not maintain sorted order
    C. They have all data at the leaf level
    D. They do not support sequential access
    Answer: C. They have all data at the leaf level
  13. What is ‘rehashing’ in the context of hash indexing?A. Computing a new hash value for an existing key
    B. Removing a key from the hash table
    C. Increasing the size of the hash table and redistributing the keys
    D. Sorting the keys in the hash table
    Answer: C. Increasing the size of the hash table and redistributing the keys
  14. In a B-tree, what is the minimum number of keys a node (except root) can have if the order is ‘m’?A. m-1
    B. m/2
    C. (m/2) – 1
    D. (m/2) + 1
    Answer: C. (m/2) – 1
  15. Which type of index is generally preferred for large databases with frequent insertions and deletions?A. B-tree index
    B. B+ tree index
    C. Hash index
    D. Bitmap index
    Answer: B. B+ tree index

 

More MCQs Of Database Systems

  1. Database Models MCQs in DBMS
    1. Hierarchical model MCQs in DBMS
    2. Network model MCQs in DBMS
    3. Relational model MCQs in DBMS
    4. Object-oriented model MCQs in DBMS
    5. NoSQL databases MCQs in DBMS
  2. Relational Database Model MCQs in DBMS
    1. tables, attributes, tuples, and relations MCQs in DBMS
    2. Primary keys and foreign keys MCQs in DBMS
    3. Integrity constraints MCQs in DBMS
  3. SQL (Structured Query Language) MCQs in DBMS
    1. Data Definition Language (DDL) MCQs in DBMS
    2. Data Manipulation Language (DML) MCQs in DBMS
    3. Data Control Language (DCL) MCQs in DBMS
    4. Transaction Control Language (TCL) MCQs in DBMS
    5. Advanced SQL queries and functions MCQs in DBMS
  4. Database Design MCQs in DBMS
    1. Entity-Relationship (ER) modeling MCQs in DBMS
    2. Extended ER modeling MCQs in DBMS
    3. Normalization and normal forms (1NF, 2NF, 3NF, BCNF) MCQs in DBMS
    4. Denormalization MCQs in DBMS
  5. Database Management System Architecture MCQs in DBMS
    1. Three-schema architecture (external, conceptual, internal) MCQs in DBMS
    2. Data independence MCQs in DBMS
    3. DBMS components and functions MCQs in DBMS
  6. Storage and File Structure MCQs in DBMS
    1. Data storage on physical media MCQs in DBMS
    2. File organization and access methods MCQs
    3. Indexing (B-trees, hash indexing) MCQs in DBMS
    4. RAID technology MCQs in DBMS
  7. Query Processing and Optimization MCQs in DBMS
  8. Database Transaction Management MCQs in DBMS
    1. ACID properties (Atomicity, Consistency, Isolation, Durability) MCQs in DBMS
    2. Transaction states and lifecycle MCQs in DBMS
    3. Concurrency control techniques (locking, timestamping, multiversion) MCQs in DBMS
    4. Deadlock detection and resolution MCQs in DBMS
  9. Database Security and Authorization MCQs in DBMS
    1. Authentication and authorization mechanisms MCQs in DBMS
    2. Data encryption techniques MCQs in DBMS
    3. Role-based access control MCQs in DBMS
    4. SQL injection prevention MCQs in DBMS
  10. Backup and Recovery MCQs in DBMS
    1. Backup types and strategies MCQs in DBMS
    2. Recovery techniques (log-based, shadow paging) MCQs in DBMS
    3. Disaster recovery planning MCQs in DBMS
  11. Distributed Databases MCQs in DBMS
    1. Distributed database architecture MCQs MCQs in DBMS
    2. Data fragmentation, replication, and allocation in DBMS
    3. Distributed query processing MCQs in DBMS
    4. Consistency models and protocols MCQs in DBMS
  1. SET 1: database design mcqs (database design mcqs )
  2. SET 2: database mcqs with answers pdf (database mcqs with answers pdf )
  3. SET 3: modern database management 12th edition mcqs (modern database management 12th edition mcqs)
  4. SET 4: database systems mcqs (database systems mcqs)
  5. SET 5: dbms mcqs (dbms mcqs )
  6. SET 6: dbms mcqs with answers (dbms mcqs with answers)
  7. SET 7: solved mcqs of dbms (solved mcqs of dbms)
  8. SET 8: dbms mcqs with answers pdf(dbms mcqs with answers pdf)
  9. SET 9: relational database management system mcqs(relational database management system mcqs)
  10. SET 10: solved mcqs of database management system(solved mcqs of database management system)
  11. SET 11: basic database mcqs pdf (basic database mcqs pdf)
  12. SET 12: relational database management system mcqs (relational database management system mcqs )
  13. SET 13: database mcqs online test (database mcqs online test)
  14. SET 14: database interview questions mcqs (database interview questions mcqs)
  15. SET 15: database developer mcqs (database developer mcqs)
  16. SET 16: database Repeated mcqs (database Repeated mcqs)
  17. SET 17: Database mcqs PPSC (Database mcqs PPSC)
  18. SET 18: Database mcqs FPSC (Database mcqs FPSC)
  19. SET 19: DBMS mcqs FPSC (DBMS mcqs FPSC)

New Arrival

Database interview questions