Let the page size be 4KB. Page header takes 128 bytes and the record index 2 bytes for each record storen in a page.
Each record has a 4 byte header. Table 'Student' has 16000 rows and it is defined as follows:
create table student (
personal_number char(11),
student_number char(15),
last_name varchar(80), /* average length 9 */
first_name varchar(80), /* average length 12 */
previous_name varchar(80), /*average length 2, mostly null */
email varchar(80), /*average 20 */
phone varchar(15), /*average 6 */
major_studies char(3),
last_visit date /* length 7 bytes*/
)
Records are not split among pages.
- How many pages are needed to store the student file when fixed size fields and records are used?
- How many pages are needed to store the student file when fields are stored in a variable length format where each field has a length byte
in front of it?