DBMS - Lecture - 4 - Normalization
DBMS - Lecture - 4 - Normalization
Normalization
3
Example 01
Department table
This table not in First Normal Form because Dloc is a Multivalued Attribute. Therefore, you
have to break this table into two different tables.
As this relation contains multi valued attributes, it is not in 1 NF.
Therefore, break the table into two tables.
Department
Dno Dname ManagerEno
Department_Location
Dno Dloc
Now both tables are in First Normal Form since all the attributes are single not
multivalued.
Example 02
7
Second Normal Form (2NF)
12
Third Normal Form (3NF)
Transitive Dependency
(X ->Z)
Condition A:
Condition B:
X is a super key of R
OR
A is a prime attribute of R (when X is not a super key)
Super Key
• Candidate keys are selected from the set of super keys, the only thing we
take care while selecting candidate key is: It should not have any
redundant attribute. That’s the reason they are also termed as minimal
super key.
Super keys: The above table has following super keys. All of the following sets of super key are able to
uniquely identify a row of the employee table.
{NIC}
{Employee_Number}
{NIC, Employee_Number}
{NIC, Emp_Name}
{Employee_Number, Emp_Name}
{NIC, Employee_Number, Emp_Name}
Candidate Keys: A candidate key is a minimal super key with no redundant attributes. The following two set
of super keys are chosen from the above sets as there are no redundant attributes in these sets.
{NIC}
{Employee_Number}
Only these two sets are candidate keys as all other sets are having redundant attributes that are not
necessary for unique identification.
Example 1
Consider the relation Supplier = {Sno, Pno, Sname, City, Status,
Pname, Qty} and the functional dependencies:
{Sno, Pno} -> {Qty}
{Sno} -> {Sname, City}
{Pno} -> {Pname}
{City} ->{Status}
Example 1:
A B C D
After decomposing the relation to meet BCNF:
A B C D
C B
Example 2:
E# Specialty Manager
A B C D E F G
Is this relation normalize? Decompose the table into suitable normalization form
2NF
A B C D A E F G
3NF
A B C D A E E F G
BCNF
A B C D A E E F G
D B