Professional Documents
Culture Documents
Introduction
• Normalization is a process of
organizing the data in
database to avoid data
redundancy, insertion
anomaly, update anomaly &
deletion anomaly
Anomalies in DBMS
• three types of anomalies that occur when the
database is not normalized
• Insertion anomaly
• update anomaly
• deletion anomaly
NON normalized table
Insertion anomaly
4 rules:
• It should only have single(atomic) valued
attributes/columns.
• Values stored in a column should be of the same
domain
• All the columns in a table should have unique
names.
• And the order in which data is stored, does not
matter.
Second Normal Form (2NF)
Candidate keys:
For the first table: EMP_ID
For the second table: EMP_DEPT
For the third table: {EMP_ID, EMP_DEPT}
4NF
What is Multi-valued Dependency?
2NF A relation will be in 2NF if it is in 1NF and all non-key attributes are fully functional
dependent on the primary key.
BCNF A stronger definition of 3NF is known as Boyce Codd's normal form.a->b a is super
key
4NF A relation will be in 4NF if it is in Boyce Codd's normal form and has no multi-valued
dependency.
5NF A relation is in 5NF. If it is in 4NF and does not contain any join dependency, joining
should be lossless.
ADV
• Normalization helps to minimize data
redundancy.
• Greater overall database organization.
• Data consistency within the database.
• Much more flexible database design.
• Enforces the concept of relational integrity.
D-ADV
• You cannot start building the database before
knowing what the user needs.
• The performance degrades when normalizing
the relations to higher normal forms, i.e., 4NF,
5NF.
• It is very time-consuming and difficult to
normalize relations of a higher degree.
• Careless decomposition may lead to a bad
database design, leading to serious problems
Denormalization in Databases
• normalize tables, we break them into multiple
smaller tables
• retrieve data from multiple tables, we need to
perform some kind of join operation on them.
• In that case, we use the denormalization
technique that eliminates the drawback of
normalization.
Pros of Denormalization