You are on page 1of 3

Lab 2

Functional dependencies and Normal forms


Exercise 1. You have been given a form which shows the details of technical jobs carried out
for different schools by members of staff in the local college. You will note that one job may
require input from more than one member of staff. Each member of staff belongs to a department
within the college and the number of hours worked on each job along with the date the job was
undertaken are noted. A member of staff may work on more than one job on any given date.

The college would like to set up a relational database to manage the allocation of staff to jobs
and keep a more efficient record of the number of hours worked for each school within the
college.

a. Give the list of functional dependencies

b. Assume that at the beginning, the database contain only one relation R(TechNo,
TechName, DeptID, Department, JobNo, Date, SchoolID, School, Hoursworked).
Normalize the database to 1NF, 2NF and 3NF (specify your responses step by
step, not only give the results).

c. Assume that at the beginning, the database contain only one relation R(TechNo,
TechName, DeptID, Department, JobNo, Date, SchoolID, School, Hoursworked).
Normalize the database to BCNF by using the BCNF decomposition algorithm.

TechNo TechName DeptId Department JobNo Date SchoolID School Hoursworked

298 Walls, Ian 1 Engineering 1002 12/9/07 192 Beauty 2.5

298 Walls, Ian 1 Engineering 1003 12/9/07 125 Computing 5.5

345 Smith, Alan 2 Helpdesk 1002 12/9/07 192 Beauty 3

345 Smith, Alan 2 Helpdesk 3440 18/9/07 346 Bus & Man 1.5

345 Smith, Alan 2 Helpdesk 1480 15/9/07 192 Beauty 3

380 Jackson, 3 Labs 3670 19/9/07 560 Design 4


Bob

380 Jackson, 3 Labs 3440 18/9/07 346 Bus & Man 2


Bob

300 Jones, Joe 2 Helpdesk 1450 15/9/07 125 Computing 1


300 Jones, Joe 2 Helpdesk 1480 15/9/07 192 Beauty 3

320 Young, Jill 3 Labs 3440 18/9/07 346 Bus & Man 4

320 Young, Jill 3 Labs 1002 12/9/07 192 Beauty 2.5

320 Young, Jill 3 Labs 3670 19/9/07 560 Design 2

Exercise 2. You are required to design a database for storing data of a clinic. For the first time
a patient come to the clinic, he/she is required to fill the following form. Note that the patient has
to give a reason for each visit to the clinic.

Patient Consultation Form

Date: ______________________ Time: ______________________

Name: ___________________________ Address: ______________________________________

Phone: ___________________________ Email: ________________________________________

Social Security Number: _______________ Date of Birth _____________ Age ________________

Sex: _________________________ Ocupation: _________________________

Emergency Contact:

Name: _________________________ Relation: ________________ Phone number: ___________

Main reason for today’s visit: ________________________________________________________

In each visit, the patient may be consulted by a main doctor who after may require him/her to do some
tests/consultations and gives him/her a list of medicines to take. The information of the
tests/consultations and medicines is as follows:

No Date Time Code Name Price Discount Result Code Name of Indication
of test of test of Doctor
Doctor
No Code of Name of Unit Quantity Unit Amount Indication Code Name
medicine medicine Price of of
Doctor Doctor

Now, design a database in 3NF suitable for this clinic.

You might also like