0% found this document useful (0 votes)
79 views

Week 8 - Normalization

1) The document discusses normalizing a patient visit database to third normal form through a series of steps. 2) It first transforms the data into first normal form by eliminating repeating groups and identifies the primary key. 3) Then it removes partial dependencies to convert it to second normal form. 4) Finally, it removes transitive dependencies to normalize the data to third normal form.

Uploaded by

Chester Manlulu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views

Week 8 - Normalization

1) The document discusses normalizing a patient visit database to third normal form through a series of steps. 2) It first transforms the data into first normal form by eliminating repeating groups and identifies the primary key. 3) Then it removes partial dependencies to convert it to second normal form. 4) Finally, it removes transitive dependencies to normalize the data to third normal form.

Uploaded by

Chester Manlulu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Page |1

INFORMATION TECHNOLOGY AND INFORMATION SYSTEM


DEPARTMENT

DATABASE MANAGEMENT SYSTEM

EXERCISE

4
NORMALIZATION

Chester Manlulu -9172


NAME SECTION

DATE PERFORMED DATE FINISHED

GJPRosales
Page |2

I. OBJECTIVES

At the end of this exercise, students must be able to:


a. Analyze data and identify the functional dependencies
b. Normalize data to third normal form

II. BACKGROUND INFORMATION

What is Normalization?
Normalization is a formal process for deciding which attributes should be
grouped together in a relation.

Steps:
1. Remove multivalued attributes (1NF)
2. Remove partial dependencies (2NF)
3. Remove transitive dependencies (3NF)

Figure 4.1 INVOICE data of Pine Valley Furniture Company

Functional dependency
The value of one attribute (the determinant) determines the value of another
attribute.

Figure 4.2 Functional Dependency Diagram for INVOICE

GJPRosales
Page |3

Order_ID → Order_Date, Customer_ID, Customer_Name, Customer_Address


Customer_ID → Customer_Name, Customer_Address
Product_ID →Product_Description, Product_Finish, Unit_Price
Order_ID, Product_ID → Order_Quantity

First Normal Form (1NF)


All attributes must be single-valued.

Figure 4.3 INVOICE relation of Pine Valley Furniture (1NF)

Product_ID → Product_Description, Product_Finish, Unit_Price


Order_ID, Product_ID → Ordered_Quantity

Second Normal Form (2NF)


A relation is in 2NF, if it is in 1NF and every non-key attribute is fully functionally
dependent on the entire primary key (no partial dependencies).

Figure 4.4 Removing partial dependencies

GJPRosales
Page |4

Third Normal Form (3NF)


For a relation to be in 3NF, it is must be in 2NF and no transitive dependencies
(functional dependencies on non-primary key attributes).

Figure 4.5 Removing transitive dependencies

III. EXPERIMENTAL PROCEDURE

Patients visit the hospital and their visit history is maintained by the hospital staff.
Different physicians may be available on different dates. They diagnose and treat
the patients of all categories. Some of treatments are free while others are to be paid
by the patients. Sample data of the case is shown in the following chart.

Table 4.1 Patient History Report


PatientID Name Address Visit Date Physician Diagnosis Treatment
P-100809 A City: X 12-02-2007 Dr. Z Chest Infection Free

20-02-2007 Dr. F Cold Free

29-02-2007 Dr. R Hepatitis-A Paid

15-03-2007 Dr. L Eyes Infection Paid


P-200145 N City: Y 10-01-2007 Dr. L Bone Fracture Paid

15-02-2007 Dr. K Cough Free

25-03-2007 Dr. A Flu Free

GJPRosales
Page |5

Task 1

Draw a dependency diagram and transform the above data to first normal
form by eliminating repeating groups such that each row in the relation is atomic. Be
sure to create an appropriate name for the relation and identify primary key/s.

Table 4.2 First Normal Form

GJPRosales
Page |6

PatientID Name Address VisitDate Physician Diagnosis Treatment


P-100809 A City: X 12-02-2007 Dr. Z Chest Infection Free
P-100809 A City: X 20-02-2007 Dr. F Cold Free
P-100809 A City: X 29-02-2007 Dr. R Hepatitis-A Free
P-100809 A City: X 15-03-2007 Dr. L Eyes Infection Free
P-200145 N City: Y 10-01-2007 Dr. L Bone Fracture Free
P-200145 N City: Y 15-02-2007 Dr. K Cough Free
P-200145 N City: Y 25-03-2007 Dr. A Flu Free

Relation Name: PatientVisitHistory


Primary Key: PatientID, VisitDate

Task 2

Remove partial dependencies to convert the relation in Task 1 to second normal


form. Be sure to create an appropriate name for the relation and identify primary
key/s.

Functional dependency:

Relation with sample data:

PatientID VisitDate Physician Diagnosis Treatment Diagnosis Treatment


(PK) (PK)
P-100809 12-02-2007 Dr. Z Chest Free
Infection
P-100809 20-02-2007 Dr. F Dr. F Cold Free
P-100809 29-02-2007 City: X Dr. R Hepatitis-A Free
P-100809 15-03-2007 City: X Dr. L Eyes Free
Infection

GJPRosales
Page |7

P-200145 10-01-2007 City: Y Dr. L Bone Free


Fracture
P-200145 15-02-2007 City: Y Dr. K Cough Free
P-200145 25-03-2007 City: Y Dr. A Flu Free

Relation Name: PatientVisitHistory

Task 3

Convert the relations in Task 2 to third normal form by removing transitive


dependencies. Be sure to create an appropriate name for the relation and identify
primary key/s.

Functional dependency:

Relation with sample data:

GJPRosales
Page |8

IV. QUESTION AND ANSWER

1. What is a well-structured relation? Why are well-structured relations


important in logical database design?

V. REFERENCES

Hoffer, J.A., Prescott, M.B., McFadden, F.R. (2016). Modern Database Management
12th Edition, Prentice Hall.

GJPRosales

You might also like