Chapter 5
Chapter 5
Normalization
Is a process used to convert complex data structures into simple, stable data structures that do not have data
redundancies?
Different types of normalization forms:
First normal form
Second normal form
Third normal form
Up to Nth normal form
EMP COURSE
Course Date_Completed
Emp_ID
10 C++ 30/11/2003
10 Report Writing 15/10/2003
11 Report Writing 20/6/2003
12 Report Writing 20/6/2003
12 Investments 15/7/2003
Figure 3 – EMP_COURSE relation,
Functional Dependence
A functional dependency: is a particular relationship between two attributes.
If a value of one attribute (A) in a relation uniquely determines the value of another attribute (B) in the same
relation, then there is a functional dependency between attributes A and B.
if we know the value of A, we can determine the value for B. In this case, B is functionally dependent on A.
i.e. as A B. Or, A determines B.
An attribute can be functionally dependent on two or more attributes.
In the EMP_COURSE relation
the value of the Date_Completed attribute cannot be determined by the Emp_ID alone or the Course value alone
Because the Date_Completed is a characteristic of an Employee taking a Course.
o The Date_Completed depends on the combination of the Emp_ID and Course values.
1.2 Second Normal Form (2NF)
A relation is in second normal form (2NF)
If every non-primary-key attribute is functionally dependent on the whole primary key.
o Figure 2, is in 1NF. the primary key consists of Emp_ID and Course.
o EMPLOYEE1 (Emp_ID,Name,Department,Salary,Course,Date_Completed)
o The functional dependencies here are:
Emp_IDName,Department,Salary
Emp_ID,CourseDate_Completed
We can say that second normal form is satisfied if:
1. The primary key consists of only one attribute
2. No non-primary-key attributes exist in the relation.
3. Every non-primary-key attribute is functionally dependent on the full set of primary key attributes.
E.g., a relation named VEHICLE, VEHICLE (Registration_No, Owner, Model, Manufacturer, Engine_Size)
This relation is in 2NF because the Registration_No uniquely determines the value of the Owner, Model,
Manufacturer and Engine_Size.
Owner Model Manufacturer Engine_Size
Registration_No
10234 TDA Land Cruiser I Toyota 2.5
10545 REST Land Cruiser II Toyota 2.9
45454 TDA Jeep Nissan 2.5
46765 REST Land Cruiser I Toyota 2.5
54098 Mekelle University Jeep Nissan 2.5
Figure 4 – VEHICLE relation – in 2NF
There are functional dependences between some of the non-primary-key attributes.
The model determines the manufacturer and engine_size. Model manufacturer, engine_size.
Because of this functional dependency, the VEHICLE relation is not in 3NF.
To convert the relation to 3NF,
Remove the functional dependency. by creating a new relation using the attributes in the dependency, with
the determinant attribute(s) being the primary key of the new relation:
VEHICLE1 (Model, Manufacturer, Engine_Size)
REGISTRATION (Registration_No, Owner, Model)
Now Both the VEHICLE1 and REGISTRATION relations are in 3NF because
they are in 2NF (every non-primay-key attribute is functionally dependent on the whole primary key)
There are no dependencies between non-primary-key attributes.