You are on page 1of 21

12.

2 DATA NORMALISATION
Prepared By: Mohammad Nabeel Arshad
12.2.1 UNDERSTAND THE CONCEPT OF DATA
REDUNDANCY AND THE PROBLEMS
ASSOCIATED WITH IT.
Data redundancy:
Data redundancy – if data in the database can be found in two different locations
(direct redundancy) or if data can be calculated from other data items (indirect
redundancy) then the data is said to contain redundancy.

Data redundancy in database means that some data fields are repeated in the
database.

This data repetition may occur either if a field is repeated in two or more tables or
if the field is repeated within the table.
Data can appear multiple times in a database for a variety of reasons. For example,
a shop may have the same customer’s name appearing several times if that
customer has bought several different products at different dates.
PROBLEMS ASSOCIATED WITH DATA
REDUNDANCY
There can be number of problems caused due to redundant data:

Increases the size of the database unnecessarily.


Causes data inconsistency.
Decreases efficiency of database.
May cause data corruption.

Such data redundancy in DBMS can be prevented by database normalization.


12.2.2 UNDERSTAND THE CONCEPT OF
AND NEED FOR NORMALISATION.
 Normalisation:
In  database design, the process of organizing data to minimize redundancy.
Normalization usually involves dividing a database into two or more tables and
defining relationships between the tables.
The objective is to isolate data so that additions, deletions, and modifications of
a field can be made in just one table and then propagated through the rest of the
database via the defined relationships.
-----------------------------------------------------------------------------------------------------
Normalization is the process of reorganizing data in a database so that it meets two
basic requirements: (1) There is no redundancy of data (all data is stored in only
one place), and (2) data dependencies are logical (all related data items are stored
together).
AIMS OF NORMALISATION

 Normalisation ensures that the database is structured in the best possible way.
 To achieve control over data redundancy. There should be no unnecessary
duplication of data in different tables.
 To ensure data consistency. Where duplication is necessary the data is the same.
 To ensure tables have a flexible structure. E.g. number of classes taken or books
borrowed should not be limited.
 To allow data in different tables can be used in complex queries.
NORMALISED DATABASE HAS MANY
ADVANTAGES

 1. Prevent the Same Data from Being Stored in Many Places

 2. Prevent Updates Made to Some Data and Not Others

 3. Prevent Deleting Unrelated Data

 4. Ensure Queries are More Efficient


12.2.3 BE ABLE TO NORMALISE A COLLECTION
OF DATA INTO FIRST, SECOND, AND THIRD
NORMAL FORMS.
 The data in the database can be considered to be in one of a number of `normal
forms'. Basically the normal form of the data indicates how much redundancy is in
that data. The normal forms have a strict ordering.
 The three main types of normalization are listed below. Note: "NF" refers to
"normal form."
 1NF
 2NF
 3NF
1NF

 First normal form (1NF) deals with the `shape' of the record type
 A relation is in 1NF if, and only if, it contains no repeating attributes or groups of
attributes.
 Example:
 The Student table with the repeating group is not in 1NF
 It has repeating groups, and it is called an `unnormalised table'.
2NF

 Second normal form (or 2NF) is a more stringent normal form defined as:
 A relation is in 2NF if, and only if, it is in 1NF and every non-key attribute is fully
functionally dependent on the whole key.

Thus the relation is in 2NF with no repeating groups, and all non-key attributes
must depend on the whole key, not just some part of it. Another way of saying
this is that there must be no partial key dependencies 
3NF

 3NF is an even stricter normal form and removes virtually all the redundant data :
 A relation is in 3NF if, and only if, it is in 2NF and there are no transitive functional
dependencies
 Transitive functional dependencies arise:
 when one non-key attribute is functionally dependent on another non-key
attribute:
 FD: non-key attribute -> non-key attribute
 and when there is redundancy in the database
 By definition transitive functional dependency can only occur if there is more than
one non-key field, so we can say that a relation in 2NF with zero or one non-key
field must automatically be in 3NF.
2NF
3NF
EXERCISE
12.2.4 BE ABLE TO DESIGN A LOGICAL DATA
MODEL (NORMALISED DATA AND RELATIONS).
 Practice Normalisation

You might also like