HomeSubjectsUniversityBlogAbout

Indexing & File Organization

Topic in Databases

210 total MCQsShowing 30 with explanations10 Easy10 Medium10 Hard

About This Topic

An index is an auxiliary data structure that speeds up record retrieval on search-key values, at the cost of extra storage and slower updates. File organization questions compare heap, sorted and hashed files, while index questions contrast primary, clustering and secondary indexes, dense and sparse indexes, and covering indexes; remember that a table can have only one clustered index. B-trees and B+ trees get detailed attention, including order, fan-out, node splits on insertion and why linked leaves help range queries. Hashing items cover static hashing with overflow chains, extendible hashing with directory doubling and linear hashing, plus bitmap and inverted indexes.

Below are 30 practice questions from a pool of 210 Indexing & File Organization MCQs, one of 17 topics in Databases. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.

Practice Questions

Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.

Indexing & File OrganizationEasy

Q1. An index in a database is used to:

  1. A.Replace primary key usage
  2. B.Slow down query results
  3. C.Speed up data retrieval✓ Correct
  4. D.Increase storage redundancy

Explanation

An index provides a fast access path to rows in a table, speeding up data retrieval.

Report an error in this question

Indexing & File OrganizationEasy

Q2. A primary index is built on:

  1. A.An unordered file without sorting
  2. B.A foreign key only in the relation
  3. C.Any non-key attribute in the table
  4. D.The primary key of an ordered file✓ Correct

Explanation

A primary index is defined on the ordering key field of an ordered (sorted) file.

Report an error in this question

Indexing & File OrganizationEasy

Q3. A dense index has:

  1. A.An entry for every block in the data file
  2. B.Only one entry for the entire data file
  3. C.An entry for every record in the data file✓ Correct
  4. D.No entries at all in the index structure

Explanation

A dense index has one index entry for every record in the data file.

Report an error in this question

Indexing & File OrganizationEasy

Q4. A sparse index has:

  1. A.An entry for every individual record stored
  2. B.An entry for each block or group of records✓ Correct
  3. C.Entries only for deleted records in the file
  4. D.No entries at all in the entire index file

Explanation

A sparse index has index entries for only some records, typically one per data block.

Report an error in this question

Indexing & File OrganizationEasy

Q5. A B-tree is a:

  1. A.Linear list with sequential access
  2. B.Balanced search tree used for indexing✓ Correct
  3. C.Binary search tree with two children
  4. D.Unbalanced tree without constraints

Explanation

A B-tree is a balanced tree structure that maintains sorted data for efficient search, insertion, and deletion.

Report an error in this question

Indexing & File OrganizationEasy

Q6. In a B+ tree, all actual data pointers are stored in:

  1. A.All nodes equally
  2. B.Leaf nodes only✓ Correct
  3. C.Root node only
  4. D.Internal nodes only

Explanation

In a B+ tree, data pointers are stored only in leaf nodes; internal nodes contain only keys for navigation.

Report an error in this question

Indexing & File OrganizationEasy

Q7. Hashing is used for:

  1. A.Direct access to records using a hash function✓ Correct
  2. B.Sorting data into a specific order on columns
  3. C.Sequential access to all records in the file
  4. D.Creating views on top of the base table data

Explanation

Hashing computes a storage address directly from the key value using a hash function.

Report an error in this question

Indexing & File OrganizationEasy

Q8. A secondary index is built on:

  1. A.The ordering field of the file
  2. B.The primary key field only
  3. C.A non-ordering field of a file✓ Correct
  4. D.A foreign key field only

Explanation

A secondary index is created on a field that is not the ordering field of the file.

Report an error in this question

Indexing & File OrganizationEasy

Q9. A clustered index means:

  1. A.Data rows are stored randomly without any ordering
  2. B.Data rows are physically stored in the index order✓ Correct
  3. C.No physical ordering is implied by the index at all
  4. D.Multiple indexes exist on the same column of data

Explanation

A clustered index determines the physical order of data rows in a table.

Report an error in this question

Indexing & File OrganizationEasy

Q10. Which data structure is commonly used for implementing indexes?

  1. A.Linked list nodes
  2. B.Stack structure
  3. C.Queue structure
  4. D.B+ tree structure✓ Correct

Explanation

B+ trees are the most commonly used data structure for database index implementation.

Report an error in this question

Indexing & File OrganizationMedium

Q11. In a B+ tree of order n, an internal node can have at most:

  1. A.n+1 keys in the node
  2. B.n keys and n children
  3. C.n children and n-1 keys✓ Correct
  4. D.2n children in total

Explanation

A B+ tree of order n has at most n children (pointers) and n-1 keys in each internal node.

Report an error in this question

Indexing & File OrganizationMedium

Q12. The height of a B+ tree with n records and order p is approximately:

  1. A.p*log(n)
  2. B.n * p
  3. C.log_p(n)✓ Correct
  4. D.n / p

Explanation

The height is approximately log base p of n, where p is the order (fan-out) of the tree.

Report an error in this question

Indexing & File OrganizationMedium

Q13. Static hashing has which disadvantage?

  1. A.Fixed number of buckets may lead to overflow as data grows✓ Correct
  2. B.It requires B+ trees to function as the base structure
  3. C.It is too slow for any practical database use case at all
  4. D.It cannot handle any data stored in the database tables

Explanation

Static hashing uses a fixed number of buckets, leading to overflow chains when data grows.

Report an error in this question

Indexing & File OrganizationMedium

Q14. Extendible hashing handles growth by:

  1. A.Deleting old records to make room for new data entries
  2. B.Using a B+ tree instead of hashing for the index data
  3. C.Increasing the number of hash functions used for keys
  4. D.Doubling the directory and splitting buckets as needed✓ Correct

Explanation

Extendible hashing uses a directory that doubles in size and splits only the overflowing bucket.

Report an error in this question

Indexing & File OrganizationMedium

Q15. Linear hashing handles growth by:

  1. A.Using a fixed number of buckets without any changes
  2. B.Splitting all buckets simultaneously at the same time
  3. C.Splitting buckets in a linear order, one at a time✓ Correct
  4. D.Never splitting any buckets regardless of the load

Explanation

Linear hashing splits buckets one at a time in a predetermined linear order as the load increases.

Report an error in this question

Indexing & File OrganizationMedium

Q16. A composite index is an index on:

  1. A.A stored procedure reference
  2. B.Two or more columns combined✓ Correct
  3. C.A view of the base table data
  4. D.A single column of the table

Explanation

A composite (concatenated) index is built on a combination of two or more columns.

Report an error in this question

Indexing & File OrganizationMedium

Q17. A covering index is one that:

  1. A.Indexes all tables in the database regardless of whether they need indexing
  2. B.Has no columns included in it and serves no purpose for query optimization
  3. C.Covers only the primary key column and does not include any other attributes
  4. D.Contains all columns needed to satisfy a query without accessing the base table✓ Correct

Explanation

A covering index includes all columns referenced by a query, eliminating the need to access the actual table.

Report an error in this question

Indexing & File OrganizationMedium

Q18. A bitmap index is most efficient for:

  1. A.Primary key columns that uniquely identify each row
  2. B.Columns with unique values that never repeat at all
  3. C.Columns with high cardinality (many distinct values)
  4. D.Columns with low cardinality (few distinct values)✓ Correct

Explanation

Bitmap indexes work best for columns with few distinct values (e.g., gender, status) in data warehousing.

Report an error in this question

Indexing & File OrganizationMedium

Q19. An index-organized table (IOT) stores:

  1. A.Data separately from all index structures created
  2. B.Data only in memory without disk-based persistence
  3. C.Data directly in the index structure (B+ tree)✓ Correct
  4. D.Data in flat files without any indexing structures

Explanation

An IOT stores the entire row data within the B+ tree index structure, eliminating separate table storage.

Report an error in this question

Indexing & File OrganizationMedium

Q20. The term fan-out in a B+ tree refers to:

  1. A.The number of records stored in the entire data file
  2. B.The maximum number of pointers (children) in a node✓ Correct
  3. C.The number of leaf nodes at the bottom of the tree
  4. D.The total height of the tree from root to leaf level

Explanation

Fan-out is the maximum number of children (pointers) an internal node can have.

Report an error in this question

Indexing & File OrganizationHard

Q21. In a B+ tree, the minimum occupancy of internal nodes (non-root) is:

  1. A.All pointers must be full
  2. B.One pointer (child) as minimum
  3. C.Exactly n pointers at all times
  4. D.Ceiling of n/2 pointers (children)✓ Correct

Explanation

Non-root internal nodes must have at least ⌈n/2⌉ children (pointers), where n is the order.

Report an error in this question

Indexing & File OrganizationHard

Q22. The global depth in extendible hashing indicates:

  1. A.The total number of records stored across all the buckets
  2. B.The number of buckets currently allocated in the structure
  3. C.The number of bits used to determine the directory entry✓ Correct
  4. D.The number of hash functions used for the key computation

Explanation

Global depth is the number of bits of the hash value used to index into the directory.

Report an error in this question

Indexing & File OrganizationHard

Q23. Local depth in extendible hashing indicates:

  1. A.The depth of the B+ tree from the root node to the leaf node level
  2. B.The total number of collisions that have occurred in the hash table
  3. C.The number of bits used to determine which bucket a record belongs to✓ Correct
  4. D.The size of the directory that maps hash values to bucket addresses

Explanation

Local depth of a bucket indicates how many bits of the hash value are used to determine membership in that bucket.

Report an error in this question

Indexing & File OrganizationHard

Q24. A hash join in query processing works by:

  1. A.Partitioning both relations using the same hash function then joining matching partitions✓ Correct
  2. B.Using an index on the join attribute to look up matching tuples from the inner relation
  3. C.Sorting both relations on the join attribute first and then merging the sorted result sets
  4. D.Using nested loops where each tuple of one relation is compared with every tuple of other

Explanation

Hash join hashes both relations on the join attribute into partitions, then probes matching partitions.

Report an error in this question

Indexing & File OrganizationHard

Q25. R-trees are used to index:

  1. A.Text data and documents only
  2. B.Temporal data and timestamps
  3. C.One-dimensional key values only
  4. D.Spatial (multidimensional) data✓ Correct

Explanation

R-trees are specialized index structures for spatial data, using minimum bounding rectangles.

Report an error in this question

Indexing & File OrganizationHard

Q26. A function-based index is created on:

  1. A.A user role that defines access permissions and grants
  2. B.A database name used to identify the schema information
  3. C.A table name stored in the database system catalog data
  4. D.The result of a function applied to one or more columns✓ Correct

Explanation

A function-based index indexes the result of a function/expression on columns (e.g., UPPER(name)).

Report an error in this question

Indexing & File OrganizationHard

Q27. An inverted index is commonly used in:

  1. A.Foreign key enforcement
  2. B.Numerical computations only
  3. C.Primary key lookups only
  4. D.Full-text search engines✓ Correct

Explanation

An inverted index maps terms to the documents/records containing them, used extensively in text search.

Report an error in this question

Indexing & File OrganizationHard

Q28. The order of a B+ tree affects performance because:

  1. A.A higher order means more keys per node, reducing tree height and disk I/O✓ Correct
  2. B.A higher order always increases the tree height and requires more disk access
  3. C.Lower order is always better because smaller nodes fit in memory more easily
  4. D.Order has no effect on performance and does not change disk I/O requirements

Explanation

Higher order means more keys per node, resulting in a shorter tree and fewer disk accesses for searches.

Report an error in this question

Indexing & File OrganizationHard

Q29. Bulk loading a B+ tree is more efficient than individual insertions because:

  1. A.It creates an unbalanced tree that must be rebalanced later
  2. B.It sorts data first and builds the tree bottom-up, minimizing splits✓ Correct
  3. C.It skips creating the tree entirely and uses a flat file instead
  4. D.It uses no sorting and inserts records in their original order

Explanation

Bulk loading sorts records first, then builds the tree bottom-up, avoiding many individual insert operations and splits.

Report an error in this question

Indexing & File OrganizationHard

Q30. A skip list can be used as an alternative to B+ trees for indexing because:

  1. A.It provides O(log n) average search, insert, and delete with simpler implementation✓ Correct
  2. B.It uses less memory than any other data structure used for indexing purposes
  3. C.It is always faster than B+ trees for every type of database query and operation
  4. D.It requires no randomization and is fully deterministic in its performance

Explanation

Skip lists offer logarithmic average-case performance with a simpler implementation than balanced trees.

Report an error in this question

Ready to test yourself on Indexing & File Organization?

Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.

Start Indexing & File Organization Quiz