Anda di halaman 1dari 6

DATABASE ASSIGNMENT

NAME
IHTISHAM TANVEER
ROLL NO
(14-43)
FUNCTIONAL DEPENDENCIES ARE

Staff DentistName PatientNo PatientName Appointment Appointment SurgeryNo


no Date Time

(StaffNo,ApptDate,AppTime) -> (PatientNo,Patient Name)


(StaffNo -> DentistName)
(PatientNo,Patient Name -> SurgeryNo)
(StaffNo,ApptDate -> SurgeryNo)
(ApptDate,ApptTime, PatientName -> DentistName,StaffNo)

FIRST NORMAL FORM:


To ensure table in first normal form we will remove all the repeating groups (appointment),
assigning new column (apptDate and apptTime) and assigned primary keys (candidate keys).
Staff no DentistName PatientNo PatientName Appointment Appointment SurgeryNo
Date Time
S1011 Tony smith P100 Gillian White 12-aug-03 10:00 S10

S1011 Tony smith P100 Jill Bell 13-aug-03 12:00 S15

S1024 Helen P108 Ian Mackay 12-sep-03 10:00 S10


pearson
S1024 Helen P108 Ian Mackay 14-sep-03 10:00 S10
pearson
S1032 Robin plevin P105 Jill bell 14-oct-03 16:30 S15

S1032 Robin plevin P110 John walker 15-oct-03 18:00 S13

The table is in fist normal form

SECOND NORMAL FORM:


To convert the above table into second normal form all the partial dependencies should be
removed
Staff no PatientNo PatientName Appointment Appointment
Date Time
S1011 P100 Gillian White 12-aug-03 10:00

S1011 P100 Jill Bell 13-aug-03 12:00

S1024 P108 Ian Mackay 12-sep-03 10:00

S1024 P108 Ian Mackay 14-sep-03 10:00

S1032 P105 Jill bell 14-oct-03 16:30

S1032 P110 John walker 15-oct-03 18:00

The staffNo and ApptDate are the foreign key

Staff no Appointment SurgeryNo


Date
S1011 12-aug-03 S10

S1011 13-aug-03 S15

S1024 12-sep-03 S10

S1024 14-sep-03 S10

S1032 14-oct-03 S15

S1032 15-oct-03 S13


The Staffno is a foreign key
Staff no DentistName

S1011 Tony smith

S1011 Tony smith

S1024 Helen
pearson
S1024 Helen
pearson
S1032 Robin plevin

S1032 Robin plevin

3rd NORMAL FORM


To convert the table in 3rd normal form non-key attribute dependency must be removed.

Staff no PatientNo Appointment Appointment


Date Time
S1011 P100 12-aug-03 10:00

S1011 P100 13-aug-03 12:00

S1024 P108 12-sep-03 10:00

S1024 P108 14-sep-03 10:00

S1032 P105 14-oct-03 16:30

S1032 P110 15-oct-03 18:00


Staff no PatientNo Appointment Appointment Staff no Appointment SurgeryNo
Date Time Date
S1011 P100 12-aug-03 10:00 S1011 12-aug-03 S10

S1011 P100 13-aug-03 12:00 S1011 13-aug-03 S15

S1024 P108 12-sep-03 10:00 S1024 12-sep-03 S10

S1024 P108 14-sep-03 10:00 S1024 14-sep-03 S10

S1032 P105 14-oct-03 16:30 S1032 14-oct-03 S15

S1032 P110 15-oct-03 18:00 S1032 15-oct-03 S13

Staff no DentistName

S1011 Tony smith

S1011 Tony smith

S1024 Helen
pearson
S1024 Helen
pearson
S1032 Robin plevin

S1032 Robin plevin


PatientNo PatientName

P100 Gillian White

P100 Jill Bell

P108 Ian Mackay

P108 Ian Mackay

P105 Jill bell

P110 John walker