Normlaization in DBMS
Normlaization in DBMS
Normalization is done through several stages, called normal forms (NFs). The most commonly
used normal forms are First Normal Form (1NF), Second Normal Form (2NF), and Third
Normal Form (3NF).
1. All attributes (columns) contain only atomic (indivisible) values, i.e., no multiple
values in a single column.
2. Each entry must be unique, with no repeating groups or arrays.
Example:
Consider a table Student_Course that records students and the courses they have taken:
In the above table, the column Courses contains multiple values for each student, violating the
1NF rule of atomicity.
To bring this table into 1NF, each course should be listed in a separate row:
Now, each column contains atomic values, and the table is in 1NF.
1. It is already in 1NF.
2. All non-key attributes are fully dependent on the primary key (no partial dependency).
Example:
Here, the primary key is a composite key made up of Student_ID and Course. However, the
Student_Name depends only on Student_ID, and the Instructor depends only on Course.
This violates 2NF because there are partial dependencies (attributes depend on part of the
composite key, not the whole key).
1. Student Table:
Student_ID Student_Name
101 Alice
102 Bob
103 Charlie
2. Course Table:
Course Instructor
Math Mr. X
English Ms. Y
Science Mr. Z
History Mr. A
Art Ms. B
3. Student_Course Table:
Student_ID Course
101 Math
101 English
102 Science
102 History
103 Math
103 Science
103 Art
Now, each table has no partial dependencies, and the database is in 2NF.
1. It is already in 2NF.
Faculty of computer science and digital innovation 3
2. There are no transitive dependencies (i.e., no non-key attribute depends on another non-
key attribute).
Example:
Here, Dept_Name and Dept_Location are dependent on Dept_ID, not on the primary key
(Employee_ID). This creates a transitive dependency: Employee_ID → Dept_ID →
Dept_Name/Dept_Location.
1. Employee Table:
2. Department Table:
Now, the database is in 3NF because there are no transitive dependencies; all non-key attributes
depend only on the primary key.
1. 1NF (First Normal Form): Eliminate repeating groups; ensure each column has atomic
values.
Issue: Some non-key attributes depend only on part of a composite primary key.
Solution: Separate tables based on full functional dependency.
3. 3NF (Third Normal Form): Eliminate transitive dependencies (non-key attributes must
depend only on the primary key).