Fundamental of Database CH-5
Fundamental of Database CH-5
Fundamental of Database CH-5
Systems(CoSc2041)
Chapter Four
Normalization
Chapter Outline
• Introduction
• Types of normalization
• 1NF
• 2nd NF
• 3rd NF
Problem with un-normalized data
• If a table is not properly normalized and have data redundancy then it will not only eat up
extra memory space but will also make it difficult to handle and update the database,
without facing data loss.
• Insert, update and delete anomalies are very frequent if database is not normalized.
Update anomalies − If data items are scattered and are not linked to each other
properly, then it could lead to strange situations.
• For example, when we try to update one data item having its copies scattered over several
places, a few instances get updated properly while a few others are left with old values.
Such instances leave the database in an inconsistent state.
Deletion anomalies − We tried to delete a record, but parts of it was left undeleted
because of unawareness, the data is also saved somewhere else.
Insert anomalies − We tried to insert data in a record that does not exist at all.
• Normalization is a method to remove all these anomalies and bring the database to a
consistent state.
Normalization
• Normalization is a mathematically rich and scientific process that reduces data redundancy.
• It is a process that “improves” a database design by generating relations that are of higher
normal forms.
• The objective of normalization is “to create relations where every dependency is on the key,
the whole key, and nothing but the key”.
Also,
Redundancy
• Boyce-Codd Normal Form (BCNF)
Number of Tables
Number of Tables
• Fourth Normal Form (4NF)
• Fifth Normal Form (5NF)
• Domain Key Normal Form (DKNF)
Most
Mostdatabases
databasesshould
shouldbe
be3NF
3NFororBCNF
BCNFin inorder
orderto
toavoid
avoidthe
the
database
databaseanomalies.
anomalies.
Level of Normalization
• We consider a relation in BCNF to be fully normalized.
• The benefit of higher normal forms is that update semantics for the affected data
are simplified.
• This means that applications required to maintain the database are simpler.
• A design that has a lower normal form than another design has more redundancy.
• We say an attribute, B, has a functional dependency on another attribute, A, if for any two
records, which have the same value for A, then the values for B in these two records must
• Example: Suppose we keep track of employee email addresses, and we only track one
email address for each employee. Suppose each employee is identified by their unique
employee number.
Transitive dependency
• A B and B C.
• Functional dependencies are transitive, which means that we also have the functional
dependency A C
• In other words, 1NF disallows relations within relations or relations as attribute values
within tuples.
A relation is in 3NF if the relation is in 2NF and all determinants of prime attributes are
candidate keys.
This definition of 3NF differs from BCNF only in the specification of prime attributes -
3NF is weaker than BCNF. (BCNF requires all determinants to be candidate keys.)
• Every relation in BCNF is also in 3NF; however, a relation in 3NF is not necessarily in
BCNF.