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

Khurram Z.

Chaudhry

Normalisation

Data held in an un-normalised format will usually contain a certain amount of data
redundancy, as multiple copies of the same data are held in the database.
Normalisation is the process whereby areas of redundancy are removed from a
database. However eliminating data redundancy is not the only reason to normalise,
there are other side effects to un-normalised data too - updating your records can be
difficult as you need to make sure that all duplicated records are updated as well
otherwise your data may be inconsistent.

Example of Data Redundancy – Appointments

Patient
App No App Time Patient No. Doctor Doctor No Room
name
A001 9.00am J Smith P1035 Dr Jones DR10 A3
A002 9.10am B Lewis P1171 Dr Jones DR10 A3
A003 9.20am J Hodgson P0060 Dr Jones DR10 A3
A004 9.30am D Harrison P0061 Dr Jones DR10 A3
A005 9.40am K Fagan P0110 Dr Jones DR10 A3

Here is the appointment schedule for Dr Jones' Surgery. As you can see there is some
duplication here - the doctor, doctor number and room have all been entered several
times.

Update side effects - if Dr Jones takes a day off, the replacement doctor will have to
take her place. This will mean that Dr Jones' name will have to be taken off the
appointments schedule for that day, and the name of the replacement doctor entered
into the database. Instead of being able to enter this information once, this will mean
entering identical information in many times.

1
Khurram Z. Chaudhry

Normal Forms

Normalisation is a step-by-step technique of putting data into "normal forms" from which
the original data can be reconstructed.

Un-Normalised (0NF)

The first stage of normalisation is to show your data un-normalised (unsorted). So your
information for your doctor's surgery might look something like this.

PATIENT (Patient number, Patient name, Address, Telephone number, Gender, Date of
birth, medical history, Appointments, appointment times, doctor number, doctor name,
surgery no, surgery hours, surgery address, surgery times)

N.B. even at this stage you should be making sure that the entity name is in block
capitals and that a primary key is defined.

First Normal Form (1NF)

First normal form involves looking at your un-normalised data and deciding which of the
attributes would have single values and which would have multiple values. For instance,
a patient would only have one patient number, one name, one address etc, but a patient
may have many appointments, prescriptions or doctors and may attend many surgeries.
So, keep all the singular valued attributes in your patient entity and make another entity
to take the multiple values. Bear in mind that your second entity will have to link to the
first so try and choose something which has a clear relationship to the first entity.

PATIENT -1 (Patient number, Patient name, Address, Telephone number, Gender, Date
of birth, medical history)

APPOINTMENTS - 1(Patient number, Doctor number, appointment details, appointment


time, doctor name, surgery no, surgery hours, surgery address, surgery times)

2
Khurram Z. Chaudhry

You can link your Patient number in your patient entity to the patient number in your
appointments entity.
N.B.. note that each entity has a suffix now "-1". This shows that we are now at first
normal form and we will use this system as we go through to third normal form.

Second Normal Form (2NF)

To get to Second Normal Form you should be looking at your Appointments entity and
deciding which of your attributes are dependent on the primary key (or on both of the
primary keys in this case). Any attribute which is not dependent on the primary keys, or
dependent on only one part of the primary keys, can be put into another table. In this
case, the Doctor name is dependent only on the Doctor Number part of the primary key,
but it is not dependent on the Patient number. So you can make another table using the
Doctor information (you should leave the Doctor Number in the Appointments table so
that a link exists)

PATIENT -2 (Patient number, Patient name, Address, Telephone number, Gender, Date
of birth, medical history)

APPOINTMENTS - 2(Patient number, Doctor number, appointment details, appointment


time, surgery no, surgery hours, surgery address, surgery times)

DOCTOR - 2(Doctor Number, Doctor name)

Third Normal Form (3NF)

Third normal form involves looking at your appointments table again and looking for
attributes that are not linked to the primary keys but have a dependent to each other,
and making another table with them.. In this case, it would be the details about the
surgery.

PATIENT -3 (Patient number, Patient name, Address, Telephone number, Gender, Date
of birth, medical history)
3
Khurram Z. Chaudhry

APPOINTMENTS - 3(Patient number, Doctor number, appointment details, appointment


time)
DOCTOR - 3(Doctor Number, Doctor name)

SURGERY - 3(Surgery no, surgery hours, surgery address, surgery times)


Your data is now fully normalised

Before you begin to create relationships between your tables you must ensure that your
data is

(a) Normalised
(b) Common fields from related tables are of exactly the same data type otherwise you
will be unable to create the relationships

Normalisation is a 3 step design method that sorts out which data items go into which
tables and how these tables are to be related.

The unorganised data goes into first normal form then, second normal form then, third
normal form. At this stage the data is said to be normalised.

Normalisation - the method

First Normal Form


 Start with all the items of data in any order in one big table
 Group the data into separate tables to remove any data that is repeated.

Second Normal Form


 Check to see if all the data in each separate table belongs to, or is uniquely
identified by the keyfield of that table
 Split the data again so that data has its own sensible keyfield.

4
Khurram Z. Chaudhry

Third Normal Form


 Check that all fields in the records of the table are really uniquely identified by the
keyfield AND are independent of one another.
 Split the data yet again so that the fields of all records belong to their keyfield
only. This will likely mean moving some fields to a new table and creating a new
keyfield for them.

That's the method. Sometimes Second and Third Normal Form are shown reversed, but
the end result is the same.

Normalisation reduces repetition to a minimum, so that a record is stored only in one


place. When it is updated, that one record is updated and it prevents two or more
versions of the same data existing. This is sometimes described as maintaining data
integrity.

You might also like