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 6–10 of 24
A data file consisting of 1,50,000 student-records is stored on a hard disk with block size of 4096 bytes. The data file is sorted on the primary key RollNo. The size of a record pointer for this disk is 7 bytes. Each student-record has a candidate key attribute called ANum of size 12 bytes. Suppose an index file with records consisting of two fields, ANum value and the record pointer the corresponding student record, is built and stored on the same disk. Assume that the records of data file and index file are not split across disk blocks. The number of blocks in the index file is ______
Answer: 698
The file is not sorted on ANum, so the index has to be dense. This means it has one entry for every record.
Size of one entry = 12 + 7 = 19 bytes Entries that fit in one block = .
Number of blocks needed =
Answer: 698
Size of one entry = 12 + 7 = 19 bytes Entries that fit in one block = .
Number of blocks needed =
Answer: 698
Consider a database implemented using B+ tree for file indexing and installed on a disk drive with block size of 4 KB. The size of search key is 12 bytes and the size of tree/disk pointer is 8 bytes. Assume that the database has one million records. Also assume that no node of the B+ tree and no records are present initially in main memory. Consider that each record fits into one disk block. The minimum number of disk accesses required to retrieve any record in the database is _______
Answer: 4
Let us check each part:
- Order p of an internal node: .
- Each leaf holds this many keys: .
For records, the number of leaves is . The next level up has nodes. After that comes 1 root. So the tree has 3 levels.
Disk accesses = 3 (tree levels) + 1 (record block) = 4
Answer: 4
- Order p of an internal node: .
- Each leaf holds this many keys: .
For records, the number of leaves is . The next level up has nodes. After that comes 1 root. So the tree has 3 levels.
Disk accesses = 3 (tree levels) + 1 (record block) = 4
Answer: 4
Which one of the following statements is NOT correct about the tree data structure used for creating an index of a relational database table?
Answer: (B)
Only the leaf nodes of a tree point to data records. Non-leaf nodes store just keys and pointers to their child nodes.
The remaining statements are correct: the tree is height balanced, keys are sorted, and the leaves are linked to each other.
Answer: Non-leaf nodes have pointers to data records
The remaining statements are correct: the tree is height balanced, keys are sorted, and the leaves are linked to each other.
Answer: Non-leaf nodes have pointers to data records
In a tree, if the search -key value is 8 bytes long, the block size is 512 bytes and the block pointer size is 2 bytes, then maximum order of the tree is _______________.
Answer: 52
A node of order p holds p block pointers and p 1 search keys.
Use the block size limit:
Answer: 52
Use the block size limit:
Answer: 52
A file is organized so that the ordering of data records is the same as or close to the ordering of data entries in some index. Then that index is called
Answer: (C)
If the records in the data file are kept in the same order as the index entries, or very close to it, then the index is a clustered index.
Answer: Clustered
Answer: Clustered
Keep practising