Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Normalization

Introduction to Normalization
Database Normalization is the process of restricting a relational database in
accordance with a series of so called normal forms in order to reduce data
redundancy and improve data integrity. It was first proposed by Edgar F. Codd as
an integral part of his relational model.

Normalization entails organizing the columns(attributes) and tables(relations) of a


database to ensure that their dependencies are properly enforced by database
integrity constraints. It is accomplished by applying some formal rules either by a
process of synthesis(creating a new database design) or decomposition
(improving an existing database design).

D_id D_Fname D_Lname D_DOB D_speciality P_id P_name P_status


D003 Mehiretab Teshome 02/02/1987 Bone P098 Ayele Hayle, Low
P132 Demsew Temesgen Medium
D122 Henok Mulu 23/12/1995 Eye P279 Alemu Demeke, Medium
P005 Mebratu Urgessa High
D078 Adenew Regassa 20/09/1990 Operation P211 Reshid Mohamed High
First let us create unnormalized table as follows :-

Patient Physical info and patient address are not specified here because of spaces
to add the column.

First Normal Form (1NF) :-is a property of relation in a relational database. A


relation is in first normal form if and only if the domain of each attribute contains
only atomic(indivisible) values, and the value of each attribute contains only a
single value from that domain.

First Normal form enforces these criteria:-

 Eliminate repeating groups in individual tables.


 Create a separate table for each set of related data.
 Identify each set of related data with a primary key
In the above table Patient information columns(P_id, Pname, Pstatus, P_DOB)
contatins more than one value for each doctor. We are duplicating related
information in the same column.

The First solution for this is write these values in different rows as follows:-

D_id D_Fname D_Lname D_DOB D_speciality P_id P_name P_status P


D003 Mehiretab Teshome 02/02/1987 Bone P098 Ayele Hayle Low 2
D003 Mehiretab Teshome 02/02/1987 Bone P132 Demsew Temesgen Medium 1
D122 Henok Mulu 23/12/1995 Eye P279 Alemu Demeke Medium 0
D122 Henok Mulu 23/12/1995 Eye P005 Mebratu Urgessa High 2
D078 Adenew Regassa 20/09/1990 Operation P211 Reshid Mohamed High 1

Note Here D_id is no longer unique in this solution with duplicated Doctors. For
this duplication there is a solution to represent a new table for patient like:-

D_id D_Fname D_Lname D_DOB D_speciality


D003 Mehiretab Teshome 02/02/1987 Bone
D003 Mehiretab Teshome 02/02/1987 Bone
D122 Henok Mulu 23/12/1995 Eye
D122 Henok Mulu 23/12/1995 Eye
D078 Adenew Regassa 20/09/1990 Operation
Patient Physical_info and Patient address are added here.

P_id P_name P_status P_Pysical_info P_address P_DOB


P098 Ayele Hayle Low 53.1, 1.68, A+ Oromia, shewa, 23/06/1992
Adama
P132 Demsew Temesgen Medium 61.4, 1.78, AB Oromia, shewa, 11/09/1986
Wenji
P279 Alemu Demeke Medium 60.8, 1.62, O Oromia, shewa, 01/04/1990
Awash
P005 Mebratu Urgessa High 59.2, 1.55, B+ Oromia, shewa, b 21/12/1996
P211 Reshid Mohamed High 70.2, 1.78, B Oromia, shewa, am 12/02/1993

The name column of Patient(P_name) can be devided into two they are patient
first name and patient last name as follows:-
P_id P_Fname P_Lname P_status P_Pysical_info P_address P_DOB
P098 Ayele Hayle Low 53.1, 1.68, A+ Oromia, shewa, Adama 23/06/1992
P132 Demsew Temesgen Medium 61.4, 1.78, AB Oromia, shewa, Wenji 11/09/1986
P279 Alemu Demeke Medium 60.8, 1.62, O Oromia, shewa, Awash 01/04/1990
P005 Mebratu Urgessa High 59.2, 1.55, B+ Oromia, shewa, b 21/12/1996
P211 Reshid Mohamed High 70.2, 1.78, B Oromia, shew, am 12/02/1993

For Doctor table the primary key is supposed to be Doctor id(D_id) and in Patient
table the primary key is supposed to be Patient id(P_id).

Second Normal Form(2NF) :- A relation that is in first normal form(1NF) must


meet additional criteria if it is to qualify for second normal form. Specially : non-
prime attribute is dependent on any proper subset of any candidate key of the
relation. A non-prime attribute of a relation is an attribute that is not a part of any
candidate key.

A functional dependency on part of any candidate key is a violation of 2NF. In


addition to the primary key, the relation may contain other candidate keys; it is
necessary to establish that no non-prime attributes have part-key dependencies
on any of these candidate keys.

In the design if we specify the doctor Full name(D_Fname and D_Lname) patient
is dependent on specific Doctor id(D_id)

Let us make the patient table in second normal from by integrating with their id
and Doctor id :-

P_id P_Fname P_Lname P_status P_DOB D_id


P098 Ayele Hayle Low 23/06/1992 D003
P132 Demsew Temesgen Medium 11/09/1986 D003
P279 Alemu Demeke Medium 01/04/1990 D122
P005 Mebratu Urgessa High 21/12/1996 D122
P211 Reshid Mohamed High 12/02/1993 D078
Patient address as follows :-

P_id region zone city


P098 Oromia Shewa Adama
P132 Oromia shewa Wendi
P279 Oromia Shewa Awash
P005 Oromia Shewa B
P211 Oromia Shew am

Patient Pysical information as


follows :-

P_id weight height Blood_type


P098 53.1 1.68 A+
P132 61.4 1.78 AB
P279 60.8 1.62 O
P005 59.2 1.55 B+
P211 70.2 1.78 B

Third Normal Form(3NF):- is a normal form that used to normalizing a database


design to reduce the duplication of data and ensure referential integrity by
ensuring that the entity in second normalized form and all the attributes in the
table are determined only by the candidate key of that relation and not by any
non-prime attribute.

A table is in Third normal form if:-

 The relation R(table) is in second normal form(2NF).


 Every non-prime attribute of R is non-transitively dependent on every key
of R.

A non-prime attribute of R is an attribute that does not belong to any candidate


key of R. A transitive dependency in which X Z (X determines Z) indirectly, by
virtue of X Y and Y Z(where it is not the case that Y X).
By the above definitions our table that is in 2NF is also 3NF because no issue that
is mentioned above is arises in our table.

You might also like