File Organization and Indexing - DPP 01
File Organization and Indexing - DPP 01
GATE
CS & IT
Q1 Assume a relational database system that holds Q3 Consider a SQL statement SELECT P1, P2, P3 from
relation: C(colleges) with the following Q WHERE P2 = ‘Pavan’ is frequently executed,
characteristics which column(s) should be considered for
• Records are stored as fixed length, fixed indexing based only on the statement itself ?
format records, length is 256 bytes. (A) P1 only (B) P2 only
• There are 16384 records. (C) P3 only (D) P1, P2 and P3
• Records contains key attribute
Q4 Consider the following specification of system-
CollegeNumber (C.N), length 22 bytes and
Disk block size = 2048 bytes
other fields.
Block pointer size = 16 bytes
• Unspanned organization is used to store the
Record pointer size = 20 bytes long
information or record.
file contains 30,000 records.
Let’s suppose we want to build a sparse primary
Each record of the file has the following fields:
index on C.N then how many numbers of 4096-
byte blocks are needed to store the primary
index when block pointer size is 10 bytes ______?
(A) 7 (B) 8
(C) 9 (D) 10
1 of 8 11/07/24, 14:24
GATE_Practice Sheet 01_DPP 1 https://qbg-admin.penpencil.co/finalize-question-paper...
GATE
Q6 Consider a database of fixed-length records Q10 The order of an internal node in B+ tree index is
2 of 8 11/07/24, 14:24
GATE_Practice Sheet 01_DPP 1 https://qbg-admin.penpencil.co/finalize-question-paper...
GATE
the maximum number of children it can have. (C) Both S1 and S2 are true
Assume that a child pointer takes 6 bytes, the (D) Neither S1 nor S2 is true
search field value takes 34 bytes and the blocks
Q15 Which of the following is/are true reading B+
size is 2048 bytes. The order of the internal node
tree?
is ________.
(A) Records can be fetched in equal number of
Q11 Assume a disk with block size B = 1024 Bytes, A disk access.
block pointer is PB = 12 bytes long and a record (B) Height of the tree remains balanced and less
pointer is PR = 18 bytes long. A file has 1,00,000 as compared to B tree.
patients records of size 100 bytes. Suppose the (C) Keys are used for indexing
file is ordered by the key field PID and we want (D) Faster search queries as the data is stored
to construct a secondary (dense) index on non- only on the leaf nodes.
key field DeptID (14 bytes), then minimum of how
Q16 Consider the following specification of system
many blocks are required to store index file
with disk block size 2048 bytes, block pointer
assuming an unspanned organisation?
size 14 bytes, record pointer size 18 bytes long
(A) 3000
and file size 60,000 records. Each record of file is
(B) 3100
256 bytes long and record of the size is sorted
(C) 3125
on the key field. If the primary index (sparse) is
(D) None of the above
built on the kye field (ESN) which is 18 bytes
Q12 The order of a node in B tree is the maximum long. What is the Index blocking factors (That is
number of block pointers it can hold. Given that number of indexes per block)
the block size is 2K bytes, data record pointer is 8 Assuming unspanned file organization
bytes long, the search key is 9 bytes long and a _________.
block pointer is 5 bytes long. The best possible
Q17 Data For This & Next Question :
order of B tree node is .
Consider a disk blocking size B = 1024 bytes. A
Q13 Consider the keys (1– 5000) are going to be block pointer is PB =12 bytes long and a record
interested into a B+ tree. Assume, all the order are pointer is PR = 7 bytes long. A file has r = 60,000
available before insertion. The orders P for B+ patient records of fixed length. The size of record
tree node is defined as- is 230 bytes. Suppose the file is not ordered by
2 to P pointer for root the key field PSN (18 bytes) and we want to
⌈ P2 ⌉ to P pointer for another node. construct a secondary index on PSN.
+ The number of first level index entries is .
The maximum possible levels in a B tree index
for P = 9 is _________.
Q18 The number of first level index block is ?
(Assume that level of the root node is 1)
(A) 1800 (B) 1825
Q14 Consider the following statements: (C) 1850 (D) 1857
S1: In a B+ tree, data pointers are stored only
Q19 Consider an unordered file of 106 records with
at the leaf nodes of the tree.
records size of 200 bytes stored on blocks of
S2: The leaf node has an entry for every
8KB with a spanned records organization. We will
value of the search field, along with the data
assume that no system related information is
pointer to the record.
stored within a block, then how many blocks
Choose the correct statements.
would it be need to store this file ?
(A) Only S1 is true
(A) 24400 (B) 24405
(B) Only S2 is true
3 of 8 11/07/24, 14:24
GATE_Practice Sheet 01_DPP 1 https://qbg-admin.penpencil.co/finalize-question-paper...
GATE
(C) 24410 (D) 24415 two di�erent denes first level indexes on various
keys.
Q20 Consider the following statements:
Select the correct statements.
S1: for any given data file, it is possible to create
(A) Only S1 correct
two di�erent sparse first level indexes on various
(B) Only S2 correct
keys.
(C) Both S1 and S2 is correct
S2: for any given data file, it is possible to create
(D) Neither is S1 nor S2 is correct.
4 of 8 11/07/24, 14:24
GATE_Practice Sheet 01_DPP 1 https://qbg-admin.penpencil.co/finalize-question-paper...
GATE
Answer Key
Q1 (B) Q11 (C)
Q2 (4096) Q12 93
Q3 (B) Q13 6
5 of 8 11/07/24, 14:24
GATE_Practice Sheet 01_DPP 1 https://qbg-admin.penpencil.co/finalize-question-paper...
GATE
Q5 Text Solution:
(a) False: A database file can contain one Given data,
clustered index because the database is sorted Disk block size = 1K byte = 210 bytes = 1024
on one field only. bytes
6 of 8 11/07/24, 14:24
GATE_Practice Sheet 01_DPP 1 https://qbg-admin.penpencil.co/finalize-question-paper...
GATE
Number of first level index blocks b1 = ⌈r1 /bfri⌉ Number of first level index entries r1 = Number of
7 of 8 11/07/24, 14:24
GATE_Practice Sheet 01_DPP 1 https://qbg-admin.penpencil.co/finalize-question-paper...
GATE
8 of 8 11/07/24, 14:24