What is Normalization? Explain 1NF, 2NF & 3NF with examples.

Normalization in DBMS

Normalization is a process in database design used to:

  • Organize data efficiently,
  • Eliminate redundancy (duplicate data),
  • Avoid anomalies (insertion, update, deletion issues),
  • Ensure data integrity.

Normalization involves breaking a database into smaller, well-structured tables using normal forms.


1. First Normal Form (1NF)

Rule:

  • Each column must contain atomic (indivisible) values.
  • No repeating groups or arrays.

Example (Unnormalized Table):

RollNoNameSubjects
101ArunMath, Physics
102MeeraEnglish

This table violates 1NF because Subjects has multiple values.

1NF Table:

RollNoNameSubject
101ArunMath
101ArunPhysics
102MeeraEnglish

Now, every field has atomic values.


2. Second Normal Form (2NF)

Rule:

  • Must be in 1NF.
  • No partial dependency: Non-prime attributes must depend on the whole primary key, not part of it.

Example:

RollNoSubjectStudentName
101MathArun
101PhysicsArun
102EnglishMeera

Here, (RollNo, Subject) is the composite key. But StudentName depends only on RollNo, not on both attributes.

2NF Tables:

Student Table:

RollNoStudentName
101Arun
102Meera

Enrollment Table:

RollNoSubject
101Math
101Physics
102English

Now, non-key attributes depend only on the full key.


3. Third Normal Form (3NF)

Rule:

  • Must be in 2NF.
  • No transitive dependency: Non-key attributes must depend only on the primary key, not on another non-key attribute.

Example:

EmpIDEmpNameDeptIDDeptName
1AshaD1HR
2RaviD2IT

Here, DeptName depends on DeptID, not directly on EmpID (transitive dependency).

3NF Tables:

Employee Table:

EmpIDEmpNameDeptID
1AshaD1
2RaviD2

Department Table:

DeptIDDeptName
D1HR
D2IT

Now, all non-key attributes depend only on the primary key, with no transitive dependencies.


Summary Table

Normal FormConditionsPurpose
1NFAtomic values, no repeating groupsEliminate multi-valued columns
2NF1NF + no partial dependenciesEliminate partial dependencies
3NF2NF + no transitive dependenciesEliminate indirect dependencies

Leave a Reply

Your email address will not be published. Required fields are marked *