0% found this document useful (0 votes)
100 views

File Structures & Indexing

The document discusses file structures and indexing in a database management system. It provides examples of record structures, calculating block size and unused space, properties of B+ tree indexes including node order and size, and questions about index sequential files, data independence, and data dictionaries.

Uploaded by

bhavesh agrawal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views

File Structures & Indexing

The document discusses file structures and indexing in a database management system. It provides examples of record structures, calculating block size and unused space, properties of B+ tree indexes including node order and size, and questions about index sequential files, data independence, and data dictionaries.

Uploaded by

bhavesh agrawal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

FILE STRUCTURES & INDEXING

Linked Questions: Q.1, Q.2, Q.3 and Q.4

1. An employee record has the following structure:

Struct employee {
int eno;
char name [22];
float salary;
char dept [10]; }

Enter the record size R in bytes.

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.

9. Index sequential file is made of all these except:

(a) primary data storage area


(b) overflow area
(c) hierarchy indices
(d) address of prime data track

2
10. Choose the correct statement:

(a) For fixed length records unspanned organization is preferred


(b) For variable length records unspanned organization is preferred
(c) For fixed length records spanned organization is preferred
(d) None of the above

11. An index is clustered, if:

(a) It is on a set of fields that form a candidate key


(b) It is on a set of fields that include the primary key
(c) The data records of the file are organized in the same order as the data entries of the index
(d) the data records of the file are organized not in the same order as the data entries of the
disk

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:

(a) Conceptual level data hiding


(b) Physical level data hiding
(c) External level data hiding
(d) None of the above

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

18. Data independency in DBMS is known as:

(a) Data modeling (b) Data hiding


(c) Data capturing (d) Data consistency

19. A data dictionary doesn’t provide information about:

(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

20. What does the data dictionary identify?

(a) Field type (b) Field type


(c) Field formats (d) All of these

You might also like