File System · Databases
24 questions · asked in 16 of 27 years (2000–2026)
MCQ 17 · MSQ 2 · NAT 51-mark 18 · 2-mark 6
2000Questions per year2026
Questions 11–15 of 24
Consider a B+ tree in which the search key is 12 bytes long, block size is 1024 bytes, record pointer is 10 bytes long and block pointer is 8 bytes long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is ____________.
Answer: 50
If a non-leaf node has n block pointers, it holds n 1 keys. Use the block size to find n:
So the number of keys is 51 1 = 50.
Answer: 50
So the number of keys is 51 1 = 50.
Answer: 50
An index is clustered, if
Answer: (C)
In a clustered index, the data records are kept in about the same order as the index entries.
Answer: the data records of the file are organized in the same order as the data entries of the index
Answer: the data records of the file are organized in the same order as the data entries of the index
Consider a file of 16384 records. Each record is 32 bytes long and its key field is of size 6 bytes. The file is ordered on a non-key field, and the file organization is unspanned. The file is stored in a file system with block size 1024 bytes, and the size of a block pointer is 10 bytes. If the secondary index is built on the key field of the file, and a multi-level index scheme is used to store the secondary index, the number of first-level and second-level blocks in the multi-level index are respectively
Answer: (C)
Each index entry is a key and a block pointer: bytes. With unspanned blocks, a block holds entries.
First level: the index is on a key field and the file is not ordered on it, so it is a secondary index and must be dense: one entry for each of the 16384 records.
Blocks =
Second level: one entry for each first-level block, so 256 entries.
Blocks =
So the first and second levels have 256 and 4 blocks.
Answer: (C)
First level: the index is on a key field and the file is not ordered on it, so it is a secondary index and must be dense: one entry for each of the 16384 records.
Blocks =
Second level: one entry for each first-level block, so 256 entries.
Blocks =
So the first and second levels have 256 and 4 blocks.
Answer: (C)
A clustering index is defined on the fields which are of type
Answer: (A)
A clustering index is made on a field that the file is ordered by, when that field is not a key. This means many records can have the same value. If the ordering field were a key, the index would be a primary index.
Answer: non-key and ordering
Answer: non-key and ordering
The order of a leaf node in a B+ tree is the maximum number of (value, data record pointer) pairs it can hold. Given that the block size is 1K bytes, data record pointer is 7 bytes long, the value field is 9 bytes long and a block pointer is 6 bytes long, what is the order of the leaf node?
Answer: (A)
Each leaf stores n (value, record pointer) pairs. It also stores one block pointer that points to the next leaf:
Answer: 63
Answer: 63
Keep practising