1 of 35

Normal Forms in DBMS

Prof.manoj kumar padhi

2 of 35

Introduction

  • Database normalization is a process to organize data efficiently.
  • It removes redundancy and ensures data integrity.
  • Developed by E.F. Codd in 1970.

3 of 35

Objectives of Normalization

  • Reduce data redundancy
  • Ensure data consistency
  • Improve data structure clarity
  • Reduce duplicate data and wasted storage.
  • Improve data consistency and integrity.
  • Make the schema easier to maintain and evolve.

4 of 35

Types of Normal Forms

  1. First Normal Form (1NF)
  2. Second Normal Form (2NF)
  3. Third Normal Form (3NF)
  4. Boyce–Codd Normal Form (BCNF)
  5. (Optional) 4NF and 5NF

5 of 35

First Normal Form (1NF)

  • Each cell contains atomic values.
  • No repeating groups or arrays.
  • Example:

StudentID

Name

Subjects

1

Subha

Java, Python

1

Subha

java

1

subha

Python

✅ (after normalization)

6 of 35

Purpose of 1NF

  • To eliminate repeating groups in tables.
  • To simplify data structure.
  • To prepare data for higher normalization levels (2NF, 3NF, etc.).

7 of 35

Advantages

  • Ensures that data is stored in a simple, tabular format.
  • Makes it easier to query and update data.
  • Reduces data redundancy.

8 of 35

Limitations

  • Does not remove partial or transitive dependencies.
  • Some redundancy may still exist.
  • More refinement is needed for 2NF and 3NF.

9 of 35

Partial dependency

  • A partial dependency occurs when a non-prime attribute (non-key attribute) depends on part of a composite primary key, not on the whole key.

In simple words:

If your table has a composite key (two or more columns as the primary key), and one of the non-key columns depends on only one part of that key, that’s called partial dependency.

10 of 35

Example

StudentID

CourseID

StudentName

CourseName

1

C1

Ramesh

DBMS

2

C2

Suresh

OS

Primary Key: (StudentID, CourseID) — composite key

StudentName depends only on StudentID

CourseName depends only on CourseID

👉 Here,

StudentName → StudentID (partial dependency)

CourseName → CourseID (partial dependency)

11 of 35

Transitive Dependency

  • A transitive dependency happens when a non-key column depends on another non-key column, instead of depending directly on the primary key.
  • 👉 In other words:
  • A non-key attribute gets its value indirectly through another non-key attribute.

12 of 35

  • Formula�if A=B AND B=C�THEN A=C

  • A = primary key
  • B = non-key attribute
  • C = another non-key attribute

13 of 35

Simple Example

  • Dependencies:
  • StudentID → DeptID ✅ (Each student belongs to one department)
  • DeptID → DeptName ✅ (Each department has one name)
  • So, indirectly:�StudentID → DeptName ❌ (Transitive dependency)

StudentID

StudentName

DeptID

DeptName

1

Raj

D1

CSE

2

Priya

D2

ECE

3

Ravi

D1

CSE

14 of 35

How to Remove Transitive Dependency:

  • Student Table
  • Department Table

StudentID

StudentName

DeptID

1

Raj

D1

2

Priya

D2

3

Ravi

D1

DeptID

DeptName

D1

CSE

D2

ECE

15 of 35

Second Normal Form (2NF)

  • A table is said to be in Second Normal Form (2NF) when:
  • It is already in First Normal Form (1NF), and
  • All non-key attributes depend on the whole primary key, not just a part of it.
  • 👉 In simple words:�There should be no partial dependency in the table.

16 of 35

Why Do We Need 2NF?

  • In 1NF, we only ensure that data is atomic (no repeating values),�but there can still be redundancy and partial dependency.
  • 2NF helps to:
  • Remove unnecessary data duplication
  • Make the database more organized and reliable

17 of 35

Example

StudentID

CourseID

StudentName

CourseName

Marks

1

C1

Raj

DBMS

85

1

C2

Raj

OS

88

2

C1

Priya

DBMS

92

Before 2NF Student table

18 of 35

How to Convert to 2NF

  • Student table Course Table

  • Enrollment Table

StudentID

StudentName

1

Raj

2

Priya

CourseID

CourseName

C1

DBMS

C2

OS

StudentID

CourseID

Marks

1

C1

85

1

C2

88

2

C1

92

19 of 35

Third Normal Form (3NF)�

  • A table is said to be in Third Normal Form (3NF) when:
  • It is already in Second Normal Form (2NF), and
  • There are no transitive dependencies between non-key attributes.
  • 👉 In simple words:
  • Every non-key attribute should depend only on the primary key, and not on another non-key attribute.

20 of 35

Rules for 3NF

Rule No.

Description

1

The table must be in 2NF.

2

There must be no transitive dependency.

3

Every non-key attribute depends only on the primary key.

21 of 35

Example (Before 3NF)

  • Table: Student_Details

  • Primary Key: StudentID

StudentID

StudentName

DeptID

DeptName

DeptHOD

1

Raj

D1

CSE

Mr. Das

2

Priya

D2

ECE

Mr. Rao

3

Ravi

D1

CSE

Mr. Das

22 of 35

  • Check the Dependencies
  • StudentName depends on StudentID ✅
  • DeptID depends on StudentID ✅
  • DeptName and DeptHOD depend on DeptID, not directly on StudentID ❌
  • So,�StudentID → DeptID and DeptID → DeptName, DeptHOD�⇒ Transitive dependency exists → ❌ violates 3NF.

23 of 35

How to Convert to 3NF

  • Student Table
  • Student Table

StudentID

StudentName

DeptID

1

Raj

D1

2

Priya

D2

3

Ravi

D1

DeptID

DeptName

DeptHOD

D1

CSE

Mr. Das

D2

ECE

Mr. Rao

24 of 35

Advantages of 3NF

  • Removes transitive dependency.
  • Further reduces data redundancy.
  • Increases data consistency and integrity.
  • Easier to update and maintain data.

25 of 35

Disadvantages of 3NF

  • Increases the number of tables (more joins needed in queries).
  • Slightly reduces performance in large databases.

26 of 35

Boyce–Codd Normal Form (BCNF)

  • Boyce–Codd Normal Form (BCNF) is an advanced version of Third Normal Form (3NF).
  • It’s used to make sure that the database does not have any kind of redundancy.
  • Simple meaning:�BCNF makes sure that every dependency in a table starts from a key.

27 of 35

BCNF Rule (Main Condition)

  • A table is in BCNF if:
  • Table must be in 3NF
  • For every functional dependency (X → Y),�X must be a super key.
  • Super key: A column (or set of columns) that can uniquely identify a record.�❌ If X is not a super key, the table is not in BCNF.

28 of 35

Why Do We Need BCNF?

  • Even after applying 3NF, some tables may still have:
  • Redundancy (same data repeated)
  • Update anomalies (wrong data after updates)
  • Insertion anomalies (difficulty adding data)
  • Deletion anomalies (loss of important data)
  • So BCNF comes in to fix these remaining issues.

29 of 35

Example

  • Table: Hostel_Room_Student Table

RoomNo

StudentName

Warden

R1

Ankit

Mr. Sharma

R2

Priya

Ms. Neha

R1

Rahul

Mr. Sharma

R3

Karan

Ms. Neha

30 of 35

How to solve

  • Table 1: Room_Warden

  • Where Room number is Super key or primary key

RoomNo

Warden

R1

Mr. Sharma

R2

Ms. Neha

R3

Ms. Neha

31 of 35

  • Table 2: Student_Room

  • Where room number is Foreign Key and Student name is unique key
  • Now, both tables are in Boyce–Codd Normal Form (BCNF).

StudentName

RoomNo

Ankit

R1

Priya

R2

Rahul

R1

Karan

R3

32 of 35

Advantages

  • Removes Redundancy – Eliminates repeated data and saves space.
  • Prevents Anomalies – No update, insert, or delete anomalies.
  • Improves Data Integrity – Each fact stored only once; data is consistent.
  • Stronger than 3NF – Fixes issues that 3NF cannot.
  • Better Data Structure – Makes database more logical and accurate.

33 of 35

Disadvantages

  • More Tables – Leads to table splitting and complex design.
  • Slower Queries – More joins required, reducing performance.
  • Difficult to Design – Requires deep understanding of dependencies.
  • Not Always Practical – Sometimes 3NF is enough for real systems.
  • Complex Insertion/Updates – Data spread across multiple tables.

34 of 35

Summary

  • 1NF: Remove repeating groups�2NF: Remove partial dependency�3NF: Remove transitive dependency�BCNF: Handle advanced dependency anomalies�4NF: Remove multi-valued dependencies�5NF: Remove join dependency redundancy

35 of 35

THANK YOU