File Structures & Indexing
File Structures & Indexing
Struct employee {
int eno;
char name [22];
float salary;
char dept [10]; }
2. In the above structure if the file has 500 records. Calculate the blocking factor bfr and the
number of blocks b, assuming an unspanned organization with block size B2 512 bytes. Enter
the value in bytes.
3. What is the unused space in each block in the above organization? Enter the value in bytes.
4. On the above organization enter the unused space in each block in the above organization.
5. The order of an internal node in B+ tree index is the maximum number of children it can have.
Suppose that a child pointer takes 6 bytes, the search field takes 14 bytes, and the block size is
512 bytes. What is the order of internal node? (Do not give in fraction)
6. A B+ tree index is to be built on the Name attributes of the relation STUDENT. Assume that
all student names are of length 8 byte, disk blocks are of size 512 byte and index pointer are of
size 4 bytes. Given this scenario, what is the best choice of the degree (i.e. number of pointers
new node) of the B+ tree?
7. Consider a relation, δ of the form SAS100(r), where r is the relation with 1000 tuples.
Assume that the attribute values for A among the tuples are uniformly distributed in the
interval [0, 500]. Which of the following option is the best estimate of the number of tuples
restored by the given selection query?
1
8. Consider the relation enrolled (student, course) in which (student, course) is the primary key,
and the relation paid (student, amount) where student is the primary key. Assume no null
values, and no foreign keys or integrity constraints. Assume that amounts: 6000, 7000, 8000,
9000 and 10,000 where each paid by 20% of the students. Consider these query plans (Plan1
on left, Plan2 on right) to “list all courses taken by students who have paid more than xy.
A disk seek takes 4ms, disk data transfer bandwidth is 300 Mb/s and checking a tuple to see
it amount is greater than x takes 10 µs. Which of the following statements is correct?
(a) Plan 1 and 2 will not output identical row sets for all database.
(b) A course may be listed more than once in the output of Plan1 for some database.
(c) For x= 5000, plan1 executes faster than Plan2 for all database.
(d) For x= 9000, Plan1 executes slower than Plan2 for all database.
2
10. Choose the correct statement:
12. The order of a leaf node in a B+ tree is the maximum number of (value, data record pointer),
it can hold. Given that the block size is 5 Kbyte, field is 9 byte long and a block pointer is 6
byte long, what is the order of the leaf node?
13. Consider a B+ tree in which the maximum number of keys in a node is 5. What is the
minimum number of keys in any non-root mode?
(a) 1 (b) 2
(c) 3 (d) 4
16. Manager’s salary details are hidden from the employee. This is:
17. A specific example where physical data independence would not hold is:
(a) When data file is changed from an unordered file to a sorted file
(b) When an additional access structure (example: an index) is created for a relation
3
(c) When DBA decides to store the data in a B+ tree
(d) When the user writes an application program to join tables
(a) where data is located (b) the size of the disk storage
(c) who owns or is responsible for the data (d) how the data is used