DBDM Exno-8
DBDM Exno-8
AIM
ALGORITHM
STEP 2: In bottom up approach the attributes and data of the table is already given
STEP 3: Using the normalization technique remove the anomalies one by one
DATABASE DESIGN
(a) The table shown in Figure 1 is susceptible to update anomalies. Provide examples of insertion,
deletion, and modification anomalies.
(b) Describe and illustrate the process of normalizing the table shown in Figure 1 to 3NF. State any
assumptions you make about the data shown in this table.
Assumptions made include that a patient is registered at only one surgery and he/she may have more
than one appointment on a given day. All the schedules have been fixed for the whole days and
week.
In the 1NF we remove all the repeating groups (appointment), assigning new column (apptDate and
apptTime) and assigned primary keys (candidate keys). Then we figure out the functional
dependencies (FDs). By using dependency diagram we represent the table as shown below. (NF –
stand for Normal Form)
FD1
FD2 FD3
FD4
FD5
The 2NF, it is already in 1NF and there is no partial dependency. So we need to remove the FD2
and FD4 by splitting into new tables and at the same time creating foreign keys. The new tables that
are in 2NF are shown below.
staffNo dentistName
FD1 is already in 2NF. In this case, we can see that FD2 (just depend on staffNo) and FD4 (just
depend on staffNo and apptDate) violate the 2NF. These two NFs are partially dependent on the
candidate keys not the whole keys. FD2 can stand on its own by depending on the staffNo and
meanwhile FD4 also can stand on its own by depending on the staffNo.
The FD3 violates the 3NF showing the transitive dependency where surgeryNo and patientName
depend on patientNo while patientNo depend on the staffNo that is the non-key is depending on
another non-key.
Finally in 3NF we must remove the transitive dependency. In this case we remove the FD3 by
splitting into a new table. The transitive dependency left is the patientName that depend on the
patientNo, so we split this into new table while creating a foreign key.
FK
staffNo apptDate apptTime patientNo
FK
staffNo dentistName
patientNo patientName
Dentist(staffNo, dentistName)
FK
staffNo apptDate surgeryNo
patientNo patientName
Patient(patientNo, patientName)
FK
staffNo apptDate apptTime patientNo
RESULT
Thus the creation of database using bottom up approach was implemented and executed
successfully.