Database Normalization - Lecture Notes
Course: Database Systems
Level: Undergraduate (BSc IT)
Learning Outcomes
Define normalization and its objectives.
Explain functional dependencies.
Normalize relations from UNF to 3NF and BCNF.
Identify insertion, update and deletion anomalies.
Introduction
Normalization is the process of organizing data in a relational database to reduce
redundancy and improve data integrity. It divides large tables into smaller related tables
while preserving relationships.
Objectives of Normalization
Reduce data redundancy
Eliminate insertion, update and deletion anomalies
Improve consistency
Simplify maintenance
Enhance data integrity
Key Terms
Attribute: A column in a table.
Tuple: A row in a table.
Primary Key: Uniquely identifies each record.
Foreign Key: References a primary key in another table.
Functional Dependency: Relationship where one attribute determines another.
Data Anomalies
Insertion anomaly: inability to add data without other data.
Update anomaly: same data updated in multiple places.
Deletion anomaly: deleting one record removes useful information.
First Normal Form (1NF)
Requirements: eliminate repeating groups; ensure atomic values; each row uniquely
identified.
Example: split multiple phone numbers into separate rows.
Second Normal Form (2NF)
Requirements: table must be in 1NF and all non-key attributes fully depend on the whole
primary key. Remove partial dependencies.
Third Normal Form (3NF)
Requirements: table must be in 2NF and contain no transitive dependencies. Non-key
attributes depend only on the primary key.
Boyce-Codd Normal Form (BCNF)
A stronger version of 3NF. Every determinant must be a candidate key.
Worked Example
UNF:
StudentID, StudentName, CourseCode, CourseName, Lecturer
Functional Dependencies:
StudentID -> StudentName
CourseCode -> CourseName, Lecturer
3NF Tables:
STUDENT(StudentID, StudentName)
COURSE(CourseCode, CourseName, Lecturer)
REGISTRATION(StudentID, CourseCode)
Advantages
Less redundancy
Improved consistency
Efficient updates
Better data integrity
Disadvantages
More joins may reduce query performance
Design can be more complex
Review Questions
Differentiate 2NF and 3NF.
Normalize a given table to 3NF.
Explain three data anomalies.
Define functional dependency with an example.