Normalisation Tutorial Questions

1. A college keeps details about a student and the various modules the student has studied. These details comprise:- registration number name address tutor number tutor name diploma code diploma name and repeating fields for module code, module name and result.

Reduce this data to third normal form.

2. Classify the following relations as unnormalised, INF, 2NF or 3NF. State any assumptions you make. If the relation is not in 3NF, normalise to 3NF.

(a) EMPLOYEE (EMP# , EMPNAME, JOBCODE) (b) EMPLOYEE (EMP# , EMPNAME, (JOBCODE, YEARS)) (c) EMPLOYEE (EMP# , EMPNAME, JOBCODE, JOB DESCRIPTION) (d) EMPLOYEE (EMP# , EMPNAME, PROJECT , HRS WORK)

3. Identify any repeating groups and functional dependencies in the PATIENT entity. Showing all the intermediate steps, derive the third normal form of the PATIENT entity.

PATIENT (Patient#, Patient-name, GP#, GP-name, Appointment-date, Consultant-name, Consultant-address, Sample-required) patient# patient- GP# GP name appt date consultant consultant sample name name address req’d 01027 Grist 919 Robinson 3/9/87 Farnes Acacia Rd blood 20/12/87 Farnes Acacia Rd none 10/10/87 Edwards Beech Ave urine 08023 Daniels 818 Seymour 3/9/87 Farnes Acacia Rd none 3/9/87 Russ Fir St sputum 191146 Falken 717 Ibbotson 4/10/87 Russ Fir St blood 001239 Burgess 818 Seymour 5/6/87 Russ Fir St sputum 007249 Lynch 717 Ibbotson 9/11/87 Edwards Beech Rd none

4. Reduce the following to BCNF, showing all steps involved.

Supplier (S#, sname, saddress, (part#, part-desc, (cust#, cust_name, cust_add, qty)))

Suppliers supply many parts to many customers. Each customer deals with only one supplier. Supplier names are unique. Customer names are not unique.

5. Normalise the following data to 3NF showing all the steps involved. GP (GP#, GPNAME, GPAdd, (Patient#, PatName, PatAdd, PatDoB, (Apptdate, Apptime, Diagnosis, Treatment))) The following functional dependencies exist: GP#->GPName, GPAdd Patient#-> PatName, PatAdd, PatDoB Patient#, Apptdate -> Apptime, Diagnosis Diagnosis-> Treatment 6. The table below shows an extract from a tour operator’s data on travel agent bookings. Derive the third normal form of the data, showing all the intermediate steps.

Department of Computing, Napier University 1 Database Systems

batch# agent# agent holiday cost qty booked airport airport name code code name 1 76 Bains B563 363 10 1 Luton travel B248 248 20 12 Edinburgh B428 322 18 11 Glasgow 2 142 Active B563 363 15 1 Luton Holidays C930 568 2 14 Newcastle A270 972 1 14 Newcastle B728 248 5 12 Edinburgh 3 76 Bains C930 568 11 1 Luton Travel A430 279 15 11 Glasgow

7. A Software consulting firm wishes to keep the following data for an employee and costing database: employee number employee name employee address salary current job code job history (job promotion code + year) office location telephone number project number project name task number task name project budget task expenditure to date department number department name There are none, one or more job promotion code/year entries per employee. The office location uniquely depends on the telephone number, and there may be more than one employee using the same telephone and more than one telephone in the one office. Tasks are numbered uniquely only within each project. An employee may be concurrently assigned to more than one project and task, but belongs to one department. Reduce this data to third normal form.

8. For each of the following relations: (a) State the normal form in its present state. (b) Identify any unwanted dependencies. (c) Give an example of an insertion and deletion anomaly. (d) Further normalise the relation.

Emp (Emp# , courses, interests) Emp# multi-determines courses Emp# multi-determines interests

Football (Player, Position, coach) Position determines coach

Emp (Emp#, Empname, proj , hrs:worked) E# determines Empname

2 J Kennedy, Dept. of Computer Studies, Napier Polytechnic