CIS 610 Assignment 1

Fall 1996 An experience on the typical problems of the physical layer of database systems

V. Matos

 

In this assignment you will write a C program to support a file organization strategy based on the DYNAMIC HASHING method. A description of the method appears in pp. 92-94 of our textbook (Elmasri-Navathe).

An employee file containing (EMPNUMBER, NAME, DEPTNUMBER, SEX) will be DYNAMICALLY HASHED. Each disk bucket will hold up to 2 records. Use the following placement (hashing) function:

Location = (binary) ( EmpNumber MOD 10 )

The program should be able to offer a menu with the following options:

    1. Read BULK data from a text file and create the DYNAMIC HASIHNG directory and a RANDOM version of the file (Direct access using the fseek(..) C function)
    2. Insert and individual employee record
    3. Delete an individual employee (the key value EmpNumber must be provided)
    4. Search and display data for a given employee.

 

OUTPUT

  1. You will hand out a copy of the source program NICELY documented. NICELY Print the dynamic directory and the individual buckets as they appear once the entire EMPLOYEE file is hashed.
  2. Test the program with the following individual records:

Use the following EMPLOYEE file:

 

SSN

EmpName

DNO

SEX

123456789

John Smith

5

M

333445555

Franklin Wong

5

M

453453453

Joyce English

5

F

666884444

Ramesh Narayan

5

M

888665555

James Borg

1

M

987654321

Jennifer Wallace

4

F

987987987

Ahmad Jabbar

4

M

999887777

Alicia Zelaya

4

F

 

Due date: Th. Oct 17.