5 - Normalization
5 - Normalization
Normalization
Lecturer : Dr. Murat AKIN
e-mail : [email protected]
Objectives of Normalization:
• Make the schema informative.
• Minimize information duplication.
• Avoid modification anomalies.
• Disallow spurious(bogus) tuples.
From the above table we can conclude some valid functional dependencies:
• roll_no → { name, dept_name, dept_building }, Here, roll_no can determine values of fields name,
dept_name and dept_building, hence a valid Functional dependency
• roll_no → dept_name , Since, roll_no can determine whole set of {name, dept_name, dept_building}, it can
determine its subset dept_name also.
• dept_name → dept_building , Dept_name can identify the dept_building accurately, since departments
with different dept_name will also have a different dept_building
• More valid functional dependencies: roll_no → name, {roll_no, name} ⇢ {dept_name, dept_building}, etc.
Here, {roll_no, name} → name is a trivial functional dependency, since the dependent
name is a subset of determinant set {roll_no, name}
Similarly, roll_no → roll_no is also an example of trivial functional dependency.
Here, roll_no → name is a non-trivial functional dependency, since the dependent name is
not a subset of determinant roll_no
Similarly, {roll_no, name} → age is also a non-trivial functional dependency, since age is not
a subset of {roll_no, name}
Here, roll_no → {name, age} is a multivalued functional dependency, since the dependents
name & age are not dependent on each other(i.e. name → age or age → name doesn’t
exist !)
Trivial FD XY,Y⊆X
Non-Prime An attribute that does not occur in any key (opposite: Prime)
Full FD X Y , ∀ A ∈ X ( ( X – {A} ) Y)
• One cannot determine whether FDs hold for all relation states unless
the meaning of and relationships among the attributes are known
AB DA
CD E DB
BD A
DC
1NF
2NF
3NF
Boyce-Codd
4NF
5NF
The decomposition of the EMPLOYEE table into 1NF has been shown below:
EMPLOYEE_DETAIL table:
That's why we need to move the EMP_STATE and EMP_CITY to the new <EMPLOYEE_ZIP>
table, with EMP_ZIP as a Primary key.
That's why we need to move the EMP_CITY and EMP_STATE to the new <EMPLOYEE_ZIP>
table, with EMP_ZIP as a Primary key.
EMPLOYEE table EMPLOYEE_ZIP table
EMP_ID EMP_NAME EMP_ZIP EMP_ZIP EMP_STATE EMP_CITY
222 Harry 201010 201010 UP Noida
333 Stephan 02228 02228 US Boston
444 Lan 60007 60007 US Chicago
555 Katharine 06389 06389 UK Norwich
666 John 462007 462007 MP Bhopal
A relation will be in 2NF if it is in 1NF and all non-key attributes are fully functional
2NF
dependent on the primary key. No partial dependency.
Any Questions