!!!!normalization Tutorial
!!!!normalization Tutorial
A key is chosen and then the repeating groups are removed to a separate data structure
together with the original key. The non-repeating fields are left behind together with the key
in their own group. The original data can still be reconstructed by using the common fields to
link the data together.
Transforming data from First Normal Form to Second Normal Form (2NF)
This stage is only concerned with the data groups that have a compound key, i.e. one which is
made up of more than one field or attribute). The process relies on the removal of part key
dependencies.
Each field or attribute is checked to see whether it depends on the whole of the key or just
part of it. The attributes that are dependent on only part of the key are removed to a separate
group with the part of the key they depend on (their determinant). The data is now described
as being in second normal form.
Transforming Data from Second Normal Form to Third Normal Form (3NF)
This process removes attributes that are not dependent on the key. In all data groups each
non-key attribute is checked to see whether it is dependent on some other non-key attribute.
The determinant attribute and its dependent attributes are removed to form a new group.
Un-normalised Data (UNF or 0NF)
Course Id Course Title Days Fees in £s Staff No Emp Name Room No Tel No Gr
C200 ER Modelling 3 300 69130 Watkins J114 2648 M
C200 ER Modelling 3 300 86250 Mortimer J224 2215
C200 ER Modelling 3 300 92020 Stubbs J224 2215 P
C300 ADT 2 225 70200 Eyres J114 2648 D
C300 ADT 2 225 88500 Davies J218 2436 M
C300 ADT 2 225 93124 Norris J123 2471
C400 OO Design 5 450 86425 Dunne J224 2215
C500 Concurrency 1 125 66575 Cox J130A 2267 M
Data Attributes:
Course Id
Course Title
No of Days
Fee
Staff No
Employee Name
Room No
Tel No
Grade
Paid
Transforming Un-normalised Data to First Normal Form
Identify a key and look for repeating groups.
Course Title Days Fees in £s Staff No Emp Name Room No Tel No Grade
Course Id
C200 ER Modelling 3 300 69130 Watkins J114 2648 M
C200 86250 Mortimer J224 2215
C200 92020 Stubbs J224 2215 P
C300 ADT 2 225 70200 Eyres J114 2648 D
C300 88500 Davies J218 2436 M
C300 93124 Norris J123 2471
C400 OO Design 5 450 86425 Dunne J224 2215
C500 Concurrency 1 125 66575 Cox J130A 2267 M
UNF 1NF
Course Id Course Id
Course Title Course Title
No of Days No of Days
Fee Fee
(Staff No
Employee Name
Room No Course Id
(Compound Key)
Tel No Staff No
Grade Employee Name
Paid) Room No
Tel No
Grade
Paid
Transforming First Normal Form to Second Normal Form
Break out part key dependencies
1NF 2NF
Course Id Course Id
Staff No Staff No
Employee Name Grade
Room No Paid
Tel No
Grade Staff No
Paid Employee Name
Room No
Tel No
2NF
3NF
Course Id Course Id
Course Title Course Title
No of Days No of Days
Fee Fee
Staff No Staff No
Employee Name Employee Name
Room No Room No
Tel No
Room No
Course Id Tel No
Staff No
Grade Course Id
Paid Staff No
Grade
Paid
anorm.doc/SM Page 5