Database Normalization Study Guide
Database Normalization Study Guide
2. Types of Dependencies
9. Comparison Tables
11. Conclusion
1. Introduction to Database Normalization
Normalization is the process of organizing data in a database to reduce redundancy (duplicate data) and
improve data integrity. It involves dividing large tables into smaller, well-structured tables and defining
relationships between them.
Why Normalize?
• Eliminate Redundancy: Remove duplicate data that wastes storage
• Prevent Anomalies: Avoid insertion, update, and deletion anomalies
• Ensure Data Integrity: Keep data accurate and consistent
• Simplify Queries: Well-structured tables make queries easier
• Easier Maintenance: Changes to data structure are localized
The Normalization Hierarchy: UNF (Unnormalized) -> 1NF -> 2NF -> 3NF -> BCNF -> 4NF -> 5NF. Each level
builds on the previous one.
2. Types of Dependencies
Understanding dependencies is the key to mastering normalization. Each normal form targets a specific type of
dependency.
Partial Dependency
Definition: A non-key attribute depends on only a PART of a composite primary key.
Transitive Dependency
Definition: A non-key attribute depends on another non-key attribute (Key -> A -> B).
Example: StudentID -> DeptID -> DeptName. DeptName transitively depends on StudentID.
Multivalued Dependency
Definition: For a key X, there exist two independent sets of values Y and Z (X ->> Y and X ->> Z).
Join Dependency
Definition: A table can be losslessly decomposed into 3+ smaller tables and rejoined to produce the original.
A. Definition
Textbook Definition: A relation is in 1NF if every attribute contains only atomic (indivisible) values, and each
record is unique.
Simple Explanation: Each cell in the table must hold only ONE value — no lists, no sets, no repeating groups.
Think of it as: one box = one item.
B. Main Rule
Eliminate repeating groups and multivalued attributes. Every column must contain only single (atomic)
values, and every row must be uniquely identifiable.
C. Why It Is Needed
• Removes repeating groups that make queries difficult
• Eliminates multivalued fields that cause confusion
• Makes data searchable and sortable
• Prevents ambiguity in data interpretation
E. Real-Life Analogy
Imagine a student registration form where one student writes multiple phone numbers in a single phone
number field. The office can't search or sort properly. 1NF says: give each phone number its own row or
column!
Problem: The 'Courses' column contains MULTIPLE values in a single cell (e.g., 'DBMS, OS, CN'). This is a
multivalued attribute — it violates 1NF because values are not atomic.
G. Converted to 1NF -- Solution
Student-Course Table (In 1NF)
How it was fixed: Each cell now contains only ONE value. The composite primary key is (StudentID, Course).
Every row is unique and every attribute is atomic.
H. Step-by-Step Conversion
Step 1: Identify columns with multiple values in a single cell
Step 3: Set a composite primary key that uniquely identifies each row
I. Important Notes
• * 1NF is the foundation — all higher normal forms require 1NF first
• * Atomic means indivisible in the context of the application
• * A table not in 1NF is not even considered a valid relation
• * Composite keys often emerge when converting to 1NF
Q3. What is the difference between a repeating group and a multivalued attribute?
Example 1: Employee-Skills
Primary Key: EmpID
Corrected:
Employee-Skill (1NF)
Fix: Each skill gets its own row. PK is now (EmpID, Skill).
Example 2: Doctor-Patients
Primary Key: DoctorID
Corrected:
Doctor-Patient (1NF)
Corrected:
Book-Author (1NF)
Example 4: Order-Products
Primary Key: OrderID
Corrected:
Order-Product (1NF)
Example 5: Teacher-Subjects
Primary Key: TeacherID
Corrected:
Teacher-Subject (1NF)
A. Definition
Textbook Definition: A relation is in 2NF if it is in 1NF and every non-key attribute is fully functionally
dependent on the entire primary key (no partial dependencies).
Simple Explanation: Every non-key column must depend on the WHOLE primary key, not just part of it. If your
key has two parts, every other column must need BOTH parts.
B. Main Rule
Remove partial dependencies. If a non-key attribute depends on only a part of a composite primary key,
move it to a separate table.
C. Why It Is Needed
• Eliminates partial dependency which causes data redundancy
• Reduces update anomalies (changing one fact requires multiple row updates)
• Prevents insertion anomalies (can't add data without unrelated data)
• Prevents deletion anomalies (deleting a row loses unrelated information)
E. Real-Life Analogy
In a hospital, a Doctor-Patient record has DoctorID + PatientID as the key. The doctor's specialization depends
only on DoctorID (partial dependency!). If you store it in this table, you'll repeat 'Cardiologist' for every patient
that doctor sees. 2NF says: move doctor info to its own table!
Problem: EmpName depends only on EmpID (partial dependency). ProjectName depends only on ProjectID
(partial dependency). Only 'Hours' depends on the full key (EmpID, ProjectID). This causes redundancy —
'Arun' and 'Website' are repeated.
EmpID EmpName
E1 Arun
E2 Meera
Project Table
ProjectID ProjectName
P1 Website
P2 App
EmpProject Table
How it was fixed: We decomposed the table into three: Employee (EmpID -> EmpName), Project (ProjectID -
> ProjectName), and EmpProject (EmpID, ProjectID -> Hours). No partial dependencies remain.
H. Step-by-Step Conversion
Step 1: Identify the composite primary key
Step 3: If any non-key attribute depends on PART of the key, it's a partial dependency
Step 4: Move partially dependent attributes to a new table with the relevant part of the key
I. Important Notes
• * 2NF only applies when the primary key is composite (has multiple columns)
• * If the primary key is a single column, a 1NF table is automatically in 2NF
• * Partial dependency = non-key attribute depends on a SUBSET of the primary key
• * Decomposition must be lossless — you should be able to reconstruct the original data using JOINs
J. Common Exam Questions
Q1. Define 2NF and partial dependency. Give an example.
Q2. Convert the given table into 2NF by removing partial dependencies.
Q3. Can a table with a single-column primary key violate 2NF? Explain.
Example 1: Student-Course-Instructor
Primary Key: (StudentID, CourseID)
Problem: StudentName depends only on StudentID; CourseFee depends only on CourseID — both are partial
dependencies.
Corrected:
Student
StudentID StudentName
S1 Rahul
S2 Abhi
Course
CourseID CourseFee
C1 5000
C2 7000
Enrollment
StudentID CourseID
S1 C1
S1 C2
S2 C1
Fix: Separated student info and course info into own tables. Enrollment links them.
Example 2: Order-Product-Details
Primary Key: (OrderID, ProductID)
Corrected:
Order
OrderID CustomerName
O1 Rahul
O2 Abhi
Product
ProductID ProductPrice
P1 500
P2 300
OrderItem
Example 3: Doctor-Patient-Clinic
Primary Key: (DoctorID, PatientID)
Doctor
Visit
Fix: Doctor info separated. Visit table holds only the full-key-dependent data.
Example 4: Movie-Actor-Details
Primary Key: (MovieID, ActorID)
Corrected:
Movie
MovieID MovieGenre
M1 Action
M2 Drama
Actor
ActorID ActorAge
A1 35
A2 28
Cast
Fix: Movie and actor facts stored once each. Cast holds combined facts.
Example 5: Teacher-Class-Schedule
Primary Key: (TeacherID, ClassID)
Corrected:
Teacher
TeacherID TeacherPhone
T1 9876543210
T2 9123456780
Class
ClassID ClassRoom
CL1 Room101
CL2 Room202
Schedule
Fix: Phone and room info stored once. Schedule links teacher to class.
5. Third Normal Form (3NF)
A. Definition
Textbook Definition: A relation is in 3NF if it is in 2NF and no non-key attribute is transitively dependent on the
primary key.
Simple Explanation: No non-key column should depend on another non-key column. Every non-key column
must depend DIRECTLY on the primary key — no middleman allowed!
B. Main Rule
Remove transitive dependencies. If A -> B -> C (where A is the key, B and C are non-key), then B -> C is a
transitive dependency. Move B -> C to a new table.
C. Why It Is Needed
• Eliminates transitive dependencies that cause hidden redundancy
• Prevents update anomalies from indirect dependencies
• Ensures every non-key fact is stored exactly once
• Makes the database easier to maintain and update
E. Real-Life Analogy
In a bookstore database, a Book table has BookID -> PublisherID -> PublisherCity. The city depends on the
publisher, not the book directly. If the publisher moves, you'd need to update EVERY book row! 3NF says: store
publisher info separately.
Problem: StudentID -> DeptID -> DeptName, HOD. DeptName and HOD depend on DeptID (a non-key
attribute), NOT directly on StudentID. This is a transitive dependency. 'CSE' and 'Dr. Sharma' are repeated for
every CSE student.
Department Table
How it was fixed: DeptName and HOD now reside in the Department table where they depend directly on
DeptID (the primary key of that table). The Student table references DeptID as a foreign key. No transitive
dependencies remain.
H. Step-by-Step Conversion
Step 1: Ensure the table is already in 2NF
Step 4: Create a new table with X as primary key and Y as its attribute
I. Important Notes
• * 3NF is the most commonly targeted normal form in practical database design
• * A transitive dependency forms a chain: Key -> A -> B
• * 3NF does NOT handle all anomalies — BCNF goes further
• * Most real-world databases aim for 3NF as a balance between normalization and performance
Q3. Normalize the given relation to 3NF showing all intermediate steps.
K. More Examples for 3NF
Here are 5 additional examples to deepen your understanding:
Example 1: Employee-Department
Primary Key: EmpID
Corrected:
Employee
Department
Fix: Department details now depend directly on DeptID in their own table.
Example 2: Book-Publisher
Primary Key: BookID
Corrected:
Book
Publisher
Example 3: Order-Customer-City
Primary Key: OrderID
Corrected:
Order
Customer
Corrected:
Patient
Ward
Fix: Ward details in own table. Updating capacity only needs one change.
Example 5: Movie-Director-Country
Primary Key: MovieID
Corrected:
Movie
Director
A. Definition
Textbook Definition: A relation is in BCNF if for every functional dependency X -> Y, X is a superkey. BCNF is a
stricter version of 3NF.
Simple Explanation: Every determinant (left side of a dependency) must be a candidate key. In simple words:
only keys can determine other columns — no exceptions!
B. Main Rule
For every functional dependency A -> B in the relation, A must be a superkey. If a non-superkey attribute
determines another attribute, decompose the table.
C. Why It Is Needed
• Handles anomalies that 3NF cannot detect
• Addresses cases where a non-key attribute determines part of a candidate key
• Provides a stronger guarantee against redundancy
• Ensures complete elimination of redundancy from functional dependencies
E. Real-Life Analogy
A university assigns professors to courses per department. A professor teaches only in ONE department, but
multiple professors can teach the same course. Here Professor -> Department, but Professor is not a key. BCNF
says: separate this out!
Problem: Candidate key: (Student, Course). FD: Professor -> Course (each professor teaches only one
course). Professor is NOT a superkey, but it determines Course. This violates BCNF. If Dr. A changes their
course, multiple rows need updating.
Professor Course
Dr. A DBMS
Dr. B OS
Dr. C OS
Student-Professor Table
Student Professor
Rahul Dr. A
Abhi Dr. A
Rahul Dr. B
Amit Dr. C
How it was fixed: We decomposed based on the violating FD (Professor -> Course). Now every determinant
is a key in its respective table. Professor is the key in Professor-Course, and (Student, Professor) is the key in
Student-Professor.
H. Step-by-Step Conversion
Step 1: Find all functional dependencies in the relation
I. Important Notes
• * Every BCNF relation is in 3NF, but not every 3NF relation is in BCNF
• * BCNF decomposition may NOT always preserve all functional dependencies
• * 3NF decomposition always preserves dependencies — this is the trade-off
• * In practice, BCNF is preferred unless dependency preservation is critical
Q2. Decompose the given relation into BCNF. Is the decomposition dependency-preserving?
Q3. What is a determinant? Explain the role of superkeys in BCNF.
Example 1: Course-Room-Instructor
Primary Key: (Course, Room)
Problem: FD: Instructor->Room (each instructor uses one room). Instructor is not a superkey — violates
BCNF.
Corrected:
Instructor-Room
Instructor Room
Dr. A R1
Dr. B R2
Dr. C R1
Course-Instructor
Course Instructor
DBMS Dr. A
DBMS Dr. B
OS Dr. C
OS Dr. A
Example 2: Student-Advisor-Dept
Primary Key: (Student, Department)
Corrected:
Advisor-Dept
Advisor Department
Dr. X CSE
Dr. Y CSE
Dr. Z ECE
Student-Advisor
Student Advisor
Rahul Dr. X
Abhi Dr. Y
Amit Dr. Z
Rahul Dr. Z
Example 3: Delivery-Driver-Area
Primary Key: OrderID
Problem: FD: Driver->Area (driver assigned to one area). In 3NF but violates BCNF since Driver is a
determinant but not superkey.
Corrected:
Driver-Area
Driver Area
Ram North
Shyam South
Order-Driver
OrderID Driver
O1 Ram
O2 Ram
O3 Shyam
O4 Shyam
Fix: Area info stored per driver, not per order. Clean BCNF.
Example 4: Flight-Pilot-Gate
Primary Key: Flight
Problem: FD: Pilot->Gate (each pilot uses assigned gate). Pilot is not a superkey.
Corrected:
Pilot-Gate
Pilot Gate
Capt. A G1
Capt. B G2
Flight-Pilot
Flight Pilot
F1 Capt. A
F2 Capt. A
F3 Capt. B
Example 5: Exam-Room-Invigilator
Primary Key: ExamCode
Corrected:
Invigilator-Room
Invigilator Room
Prof. P R101
Prof. Q R202
Exam-Invigilator
ExamCode Invigilator
EX1 Prof. P
EX2 Prof. P
EX3 Prof. Q
A. Definition
Textbook Definition: A relation is in 4NF if it is in BCNF and contains no non-trivial multivalued dependencies.
Simple Explanation: A table should not have two or more independent multivalued facts about the same
entity. If a student has multiple hobbies AND multiple phone numbers (independently), store them in separate
tables!
B. Main Rule
For every non-trivial multivalued dependency X ->> Y, X must be a superkey. If two independent multivalued
attributes exist, decompose the table.
C. Why It Is Needed
• Eliminates redundancy caused by independent multivalued facts
• Prevents the Cartesian product explosion of unrelated data
• Reduces storage waste from artificial combinations
• Makes insertions and deletions cleaner
E. Real-Life Analogy
A movie actor works in multiple movies AND speaks multiple languages. These are independent facts. Storing
both in one table creates fake combinations — as if the actor speaks Hindi BECAUSE of Movie X. 4NF says:
separate movies and languages!
Problem: ActorID ->> Movie and ActorID ->> Language are independent multivalued dependencies. Actor
A1's movies and languages are unrelated, but we're forced to create all combinations (2 movies x 2
languages = 4 rows). This is redundant!
G. Converted to 4NF -- Solution
Actor-Movie Table
ActorID Movie
A1 Film1
A1 Film2
A2 Film3
Actor-Language Table
ActorID Language
A1 Hindi
A1 English
A2 Tamil
How it was fixed: By separating the two independent multivalued dependencies into their own tables, we
eliminate the Cartesian product redundancy. Actor A1 now has 2+2=4 rows total instead of 2x2=4 rows in
one table, and adding a new movie doesn't require duplicating languages.
H. Step-by-Step Conversion
Step 1: Ensure the table is in BCNF
Step 3: Check if multiple independent MVDs exist for the same key
Step 5: Each new table has the key plus one multivalued attribute
I. Important Notes
• * Multivalued dependency (MVD): X ->> Y means for each X, there's a well-defined set of Y values,
independent of other attributes
• * 4NF violations cause Cartesian product redundancy
• * A trivial MVD is when Y is a subset of X or X union Y is the entire set of attributes
• * 4NF is important for tables with multiple independent 1:N relationships
Q2. Give an example of a table in BCNF but not in 4NF. Convert it to 4NF.
Example 1: Student-Hobby-Sport
Primary Key: (StudentID, Hobby, Sport)
Problem: StudentID->>Hobby and StudentID->>Sport independently. 2 hobbies x 2 sports = 4 rows for S1.
Corrected:
Student-Hobby
StudentID Hobby
S1 Reading
S1 Painting
Student-Sport
StudentID Sport
S1 Cricket
S1 Football
Fix: Independent facts separated. 2+2=4 rows instead of 2x2=4 in one table.
Example 2: Employee-Skill-Language
Primary Key: (EmpID, Skill, Language)
Corrected:
Emp-Skill
EmpID Skill
E1 Java
E1 Python
Emp-Language
EmpID Language
E1 Hindi
E1 English
Example 3: Teacher-Subject-Certification
Primary Key: (TeacherID, Subject, Certification)
Corrected:
Teacher-Subject
TeacherID Subject
T1 Maths
T1 Physics
Teacher-Cert
TeacherID Certification
T1 [Link]
T1 [Link]
Corrected:
Company-Product
CompanyID Product
C1 Phone
C1 Laptop
Company-Market
CompanyID Market
C1 India
C1 USA
Fix: Products and markets are independent lists — no Cartesian product needed.
Example 5: Author-Book-Award
Primary Key: (AuthorID, Book, Award)
Corrected:
Author-Book
AuthorID Book
A1 Novel1
A1 Novel2
Author-Award
AuthorID Award
A1 Booker
A1 Pulitzer
Fix: Books and awards separated. Adding a new book doesn't duplicate awards.
8. Fifth Normal Form (5NF)
A. Definition
Textbook Definition: A relation is in 5NF (also called Project-Join Normal Form / PJNF) if it is in 4NF and cannot
be further decomposed without losing data (no non-trivial join dependencies).
Simple Explanation: A table is in 5NF when it cannot be split into smaller tables and then joined back without
creating false (spurious) data. It deals with complex relationships among THREE or more entities.
B. Main Rule
Every non-trivial join dependency must be implied by the candidate keys. If a table can be losslessly
decomposed into three or more smaller tables, it should be.
C. Why It Is Needed
• Handles complex multi-way relationships that 4NF misses
• Eliminates subtle redundancy from join dependencies
• Ensures the database captures only true real-world relationships
• Prevents spurious tuples when reconstructing data
E. Real-Life Analogy
A supplier can supply certain parts, and certain projects need certain parts, and certain suppliers work with
certain projects. These three pairwise relationships together represent a three-way constraint. Storing all three
pairs in one table might imply false combinations. 5NF says: decompose into three binary tables if the three-
way relationship is really just pairwise!
Problem: This table has a join dependency: it can be decomposed into three tables (Supplier-Part, Part-
Project, Supplier-Project) and rejoined losslessly. The three-way fact is actually composed of three binary
facts. Keeping it as one table creates redundancy.
Supplier Part
S1 Bolt
S1 Nut
S2 Bolt
Part-Project Table
Part Project
Bolt ProjA
Nut ProjA
Bolt ProjB
Supplier-Project Table
Supplier Project
S1 ProjA
S1 ProjB
S2 ProjA
How it was fixed: The original table is decomposed into three binary relationship tables. When you JOIN all
three, you get exactly the original data — no more, no less. Each binary relationship is stored independently,
eliminating redundancy from the three-way coupling.
H. Step-by-Step Conversion
Step 1: Ensure the table is in 4NF
Step 4: Verify that joining the projections produces exactly the original table (lossless)
I. Important Notes
• * 5NF is also called PJNF (Project-Join Normal Form)
• * 5NF violations are rare in practice but important theoretically
• * Testing for 5NF requires checking all possible decompositions
• * 5NF guarantees the database is fully normalized with respect to all dependencies
Q3. Why is 5NF also called Project-Join Normal Form? Differentiate from 4NF.
Example 1: Agent-Company-Product
Primary Key: (Agent, Company, Product)
Problem: Three-way relationship decomposable into three binary tables without data loss.
Corrected:
Agent-Company
Agent Company
A1 TCS
A1 Wipro
A2 TCS
Company-Product
Company Product
TCS Laptop
TCS Phone
Wipro Laptop
Agent-Product
Agent Product
A1 Laptop
A1 Phone
A2 Phone
Fix: Three pairwise tables. JOIN reproduces original exactly.
Example 2: Student-Subject-Semester
Primary Key: (Student, Subject, Semester)
Corrected:
Student-Subject
Student Subject
Rahul DBMS
Rahul OS
Abhi DBMS
Subject-Semester
Subject Semester
DBMS Sem3
DBMS Sem4
OS Sem3
Student-Semester
Student Semester
Rahul Sem3
Rahul Sem4
Abhi Sem3
Fix: Three binary facts. Natural join gives back exact original data.
Example 3: Doctor-Hospital-Treatment
Primary Key: (Doctor, Hospital, Treatment)
Problem: Join dependency exists — decomposable into three binary relations losslessly.
Corrected:
Doctor-Hospital
Doctor Hospital
Dr. A H1
Dr. A H2
Dr. B H1
Hospital-Treatment
Hospital Treatment
H1 Surgery
H1 Checkup
H2 Surgery
Doctor-Treatment
Doctor Treatment
Dr. A Surgery
Dr. A Checkup
Dr. B Checkup
Example 4: Instructor-Course-Textbook
Primary Key: (Instructor, Course, Textbook)
Problem: Three-way fact is actually three pairwise facts. Join dependency exists.
Corrected:
Instructor-Course
Instructor Course
Prof. X DBMS
Prof. Y DBMS
Prof. X OS
Course-Textbook
Course Textbook
DBMS Navathe
DBMS Silberschatz
OS Stallings
Instructor-Textbook
Instructor Textbook
Prof. X Navathe
Prof. X Silberschatz
Prof. Y Navathe
Prof. X Stallings
Example 5: Salesman-City-Product
Primary Key: (Salesman, City, Product)
Corrected:
Salesman-City
Salesman City
S1 Delhi
S1 Mumbai
S2 Delhi
City-Product
City Product
Delhi TV
Delhi AC
Mumbai TV
Salesman-Product
Salesman Product
S1 TV
S1 AC
S2 AC
Remember: "The key, the whole key, and nothing but the key -- so help me Codd!" This famous phrase
captures the essence of normalization. Master this, and you'll master normalization!