Assignment 5
Assignment 5
Questions:
1.Explain 1NF, 2NF and 3NF with suitable
examples.
2.Write down Advantages and Disadvantages of
Normalization.
Ans-1:
Normalization Forms:
Normalization is a process of organizing the data in a
database to minimize data redundancy and dependency.
Normalization involves dividing large tables into smaller
tables and linking them through relationships.
First Normal Form (1NF)
A table is in 1NF if it does not contain any composite or
multi-valued attribute. A relation is in first normal form if
every attribute in that relation is a single-valued attribute.
Example:
Bad table:
ID Name Course
1 A C1,c2
Good table:
ID Name Course
1 A C1
1 A C2
In this table, the primary key is (Order ID, Product ID). The non-prime
attributes (Customer ID, Order Date, Quantity) depend on the entire
primary key, not just one part of it. Therefore, this table is in 2NF.
Third Normal Form (3NF)
A relation is said to be in third normal form, if we did not have any
transitive dependency for non-prime attributes. The basic condition
with the Third Normal Form is that, the relation must be in Second
Normal Form.
Example Tables:
In this example, we have two tables: Orders and Order Items. The
Orders table has the primary key (Order ID), and the Order Items table
has the primary key (Order ID, Product ID). There are no transitive
dependencies, and each non-prime attribute depends only on the
primary key. Therefore, these tables are in 3NF.
ANS-2:
ADVANTAGES OF NORMALIZATION:
DATA CONSISTENCY
DATA REDUNDANCY
RESPONSE TIME
DISADVANTAGES OF NORMALIZATION:
DENORMALIZATION AS AN ALTERNATIVE