Normalization Exercise Dentistry
Normalization Exercise Dentistry
• {staffNo} → {dentistName}
• {patientNo} → {patientName} – Assume that the patient names and the dentist names are not
unique. The only way to uniquely identify these individuals is by their respective number.
There are two candidate keys here. Remember first that a candidate key is a superkey, meaning that the
functional dependency A → B covers all of the columns in the table. Further, a candidate key is minimal.
The third and the fourth functional dependencies both meet those requirements.
To get it into first normal form, we simply need to decompose appointment into its two components:
appointment date and appointment time. This is an example of an attribute that’s not atomic. It’s not
multi-valued, nor is it repeating, but I’m arguing that we have two values in one as it stands.
Regardless of which of the two candidate keys that you choose to use for the primary key, we have some
work to do to get it into 2nd normal form. If you use functional dependency #3, then {staffNo} →
{dentistName} is a subkey in which the subkey is part of the primary key. If you go with functional
dependency #4 for the primary key, then {patientNo} → {patientName} is a subkey that is part of the
primary key.
Then, to address third normal form, we see that if we use the 3rd functional dependency as the primary
key, then {patientNo} → {patientName} requires that we split that out into a relation of its own to get into
3rd normal form. In a parallel fashion, if we use the 4th functional dependency as our primary key, then
we have to factor out the {staffNo} → {dentistName} functional dependency.
The {staffNo} → {dentistName} functional dependency means that our previous structure violated 2nd
normal form since staffNo is part of the primary key. Refactoring that functional dependency out into a
separate scheme gives us the above relation scheme model. We still are not in 3rd normal form because
of the {patientNo} → {patientName} functional dependency. We did not address that last functional
dependency yet because it’s not part of the primary key.
Hopefully, this looks like a many to many with history. It is with history because a given dentist could
perform a surgery on the same patient more than once. You could say that {appointment date,
appointment time} forms the discriminator for this many to many with history, but I’d cringe a little at
that because the primary key of Dental Appointment does not require the patientNo.
I will leave it as an exercise to the student to work through 2nd and third normal form if you had decided
to go with the 4th functional dependency as your primary key.