IT3142 - Database Administration Assignment 3 - Fall 2020: Student ID: 004 Name:Amina Arif Batch:2 Program:BS - IT
IT3142 - Database Administration Assignment 3 - Fall 2020: Student ID: 004 Name:Amina Arif Batch:2 Program:BS - IT
Attempt each question. Marks are specified with each question. 10 – Marks
Q 1. Why is accessing a disk block expensive? Discuss the time components involved in accessing a
disk block.
The data is arranged in an order and then stored in a block of the disk is said to be known as
blocking. The data can be transferred from the disk to the main memory in units.
Accessing the data in the main memory is less expensive than accessing the data in the disk. This is
due to the following components.
Seek time
Seek time is defined as the time taken to move the disk heads to the track on which a
desired block is located.
Rotational latency
Rotational delay is defined as the waiting time for the desired block to rotate under the disk
head; it is the time required for half a rotation on average and is usually less than seek time.
Block transfer time
Transfer time is defined as the time to actually read or write the data in the block once the
head is positioned, that is, the time for the disk to rotate over the block.
So, access to data on disk is several orders of magnitude slower than is access to data in main
memory.
IT3142 – Database Administration
Q 2. What are the reasons for having variable-length records? What types of separator characters are
needed for each?
There are many reasons to add a variable-length field to a record. With variable length records there is
no space wastage. Special separator characters among the records are used to delineate variable length
records.
Design the table as having variable record length and put the “comments” field at the end of the record,
Add a comments field to a fixed record length table with a length of for example 256 bytes. Put the
comments in a separate table and join the tables with an auto increment column in the memo table.
One can be if one or more fields are of variable length.
A second would be if one or more fields have multiple values for individual records with repeating field.
Or one or more fields in a record are optional. A user can separate records of variable lengthens using
certain characters like $,? or % these don’t appear as values in the field. But can instead be used to
terminate the length field. It can be difficult to determine where one starts and another ends which is
why we use these special characters to make endings.