Normalization

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Normalization

Functional Dependencies
If in a table column X uniquely identifies column Y of
same table then we can say that attribute Y is functionally
dependent of attribute X.

It can represented as X→Y

Types of Functional Dependencies


1. Trivial functional dependency
2. non-trivial functional dependency
3. Multivalued dependency
4. Transitive dependency
Trivial Functional Dependency
Non-trivial Functional Dependency
Multivalued Dependency
Transitive Dependency
Normalization

• Organizing the data in database so that data redundancy,


insertion anomaly, update anomaly & deletion anomaly can
be avoided is called normalization.
• If a database is not normalized there will be three type of
anomalies which occurs:
1. Insertion anomaly
2. Update anomaly
3. Deletion anomaly
• Example-
Normal Forms

• First normal form(1NF)- An attribute in a table must have


atomic values that means it can not have multiple values.

• Second normal form(2NF)- 1st NF + No non-prime attribute


should have partial dependency on any candidate key of
table.

• Third normal form(3NF)- 2nd NF + No Transitive functional


dependency of non-prime attribute on any super key
Example 1-
• Let R(A,B,C,D,E) be a relation with set of functional
dependencies {A →B,B →C,D →E}.
• Now we will find the candidate key that is (A,E).
• The table is in 1st NF because it has all atomic values but to be
in 2nd NF all non-prime attribute should have full dependency
on key not on the part of key. Here attribute B and C are only
dependent on A and E is only dependent on D. so the relation
is not in second NF.
Example 2-
• Let R(A,B,C,D,E) be a relation with set of
functional dependencies {A →B,B →CD,D →E}.
• Now we will find the candidate key that is A.
• The table is in 1st NF because it has all atomic
values but to be in 2nd NF all non-prime attribute
should have full dependency on key not on the
part of key. Here all attribute are fully dependent
on A. so the relation is in second NF. But there is
transitive dependency between A to D and A to
E. So the relation is not in 3 NF.
Disclaimer
“This content is solely for the purpose of e-learning by students and
any commercial use is not permitted. The author does not claim
originality of the content and it is based on the following references”

References:
• Korth, Silbertz, Sudarshan,” Database Concepts”, McGraw Hill.
• Date C J, “ An Introduction to Database Systems”, Addision Wesley.
• Bipin C. Desai, “ An Introduction to Database Systems”, Gagotia
Publications.
• Majumdar & Bhattacharya, “Database Management System”, TMH.
• Ramkrishnan, Gehrke, “ Database Management System”,
McGraw Hill.
• www.javatpoint.com
• www.tutorialspoint.com

You might also like