Normalization: Background Knowledge
Normalization: Background Knowledge
Background Knowledge
o Anomaly
It is an inconsistency that may arise when a user tries to insert data (insertion
anomaly) or tries to modify data (modification / updation anomaly) or tries to
delete data (deletion anomaly).
Student
R# Name C-Code C-Title
1 Faisal Cs-342 OS
2 Imran Cs-342 OS
5 Ali
Insertion Anomaly
We can’t insert data of a student unless he registers some course, or vice
versa.
Deletion Anomaly
If we want to delete student data R#-4, Ahsan, we also lose data about
the course Cs-312, DLD.
DBMS
- Normal Form
It is the state or form of a relation that arises when we apply some rules of
normalization on that relation, for example First Normal Form or 1NF, 2NF etc.
o 1NF
A relation is said to be in 1NF if it doesn’t have any repeating group.
Problem
R# Name C-Code C-Title
1 Faisal Cs-342 OS
2 Imran Cs-342 OS
1 Faisal Cs-342 OS
2 Imran Cs-342 OS
Functional Dependency
If we have a relation
R (A1, A2, A3, A4, A5)
Student (R#, name, C-Code, C-Title)
If A1 determines A2, A3, A4, A5 then we say that A2, A3, A4, A5 are
functionally dependent upon A1.
1 Faisal Cs-342 OS A
2 Imran Cs-342 OS A
For example
R (A, B, C, D, E)
And in this relation AB, C, D, E but CE as well.
Hints
1. Customer can be served by only one sales person, while a sales
person can serve many customers.
2. One sales person belongs to only one region, while a region can
have many sales persons.
DBMS