0% found this document useful (0 votes)
85 views

!!!!normalization Tutorial

Normalisation is a process used to organise data into tables to eliminate redundancy and inconsistencies. It involves breaking down data into first normal form by separating repeating groups, second normal form by removing partial dependencies, and third normal form by removing non-key attributes dependent on other non-key attributes. The example shows a document describing the normalisation process and transforming sample unnormalised data through each normal form into multiple tables in third normal form.

Uploaded by

trucious
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views

!!!!normalization Tutorial

Normalisation is a process used to organise data into tables to eliminate redundancy and inconsistencies. It involves breaking down data into first normal form by separating repeating groups, second normal form by removing partial dependencies, and third normal form by removing non-key attributes dependent on other non-key attributes. The example shows a document describing the normalisation process and transforming sample unnormalised data through each normal form into multiple tables in third normal form.

Uploaded by

trucious
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Normalisation

Normalisation is the process, consisting of a series of steps, used to convert representations of


data into two or more tables to minimise data redundancy and eliminate data maintenance
side effects. After normalising data, it should always be possible to regenerate the original
data.

Un-normalised Form (UNF or 0NF)


Un-normalised data consists of a list of fields obtained from an organisation's documentation
or processes. Repeating fields are identified which provides a starting point for the
normalisation process. Un-normalised data is said to be in un-normalised form, UNF or 0NF.

Transforming Un-normalised Data to First Normal Form (1NF)


The first stage is to transform the un-normalised data into first normal form. This is achieved
by removing repeating groups to a separate data structure.

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.

The data will now be in First Normal Form.

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 Note: this group does not have a


Course Title Course Title compound key and so it is
No of Days No of Days unaffected.
Fee Fee

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

Tables in Second Normal Form


Data Group: Staff
StaffNo EmpName RoomNo Tel No CourseId StaffNo Grade Paid
69130 Watkins J114 2648 C200 69130 M Y
86250 Mortimer J224 2215 C200 86250 N
92020 Stubbs J224 2215 C200 92020 P Y
70200 Eyres J114 2648 C300 70200 D N
88500 Davies J218 2436 C300 88500 M Y
93124 Norris J123 2471 C300 93124 Y
86425 Dunne J224 2215 C400 86425 N
66575 Cox J130A 2267 C500 66575 M Y

Data Group: Course


CourseId CourseTitle Days Fees
C200 ER Modelling 3 300
C300 ADT 2 225
C400 OO Design 5 450
C500 Concurrency 1 125
Transforming Second Normal Form to Third Normal Form
Remove attributes which are dependent on other non-key attributes

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

Tables in Third Normal Form

Data Group: Staff Data Group: Course/Staff


StaffNo EmpName RoomNo CourseId StaffNo Grade Paid
69130 Watkins J114 C200 69130 M Y
86250 Mortimer J224 C200 86250 N
92020 Stubbs J224 C200 92020 P Y
70200 Eyres J114 C300 70200 D N
88500 Davies J218 C300 88500 M Y
93124 Norris J123 C300 93124 Y
86425 Dunne J224 C400 86425 N
66575 Cox J130A C500 66575 M Y

Data Group: Room Data Group: Course


RoomNo TelNo CourseId CourseTitle Days Fees
J114 2648 C200 ER Modelling 3 300
J224 2215 C300 ADT 2 225
J218 2436 C400 OO Design 5 450
J123 2471 C500 Concurrency 1 125
J130A 2267

anorm.doc/SM Page 5

You might also like