As an example, let us consider a file of instructor records for our university
database. Each record of this file is defined (in pseudocode) as:
type instructor = record
ID varchar (5);
name varchar(20);
dept name varchar (20);
salary numeric (8,2);
end
Assume that each character occupies 1 byte and that numeric (8,2) occupies
8 bytes. Suppose that instead of allocating a variable amount of bytes for the
attributes ID, name, and dept name, we allocate the maximum number of bytes
that each attribute can hold. Then, the instructor record is 53 bytes long. A simple
approach is to use the first 53 bytes for the first record, the next 53 bytes for the
second record, and so on (Figure 10.4). However, there are two problems with
this simple approach: