Extra Information on Normalization Justification (3NF)
🧾 Normalization Justification (3NF)
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. In this lab, we ensured the schema followed Third Normal Form (3NF). Below is the explanation for each normalization step:
✅ First Normal Form (1NF) – Atomicity
-
Rule: Each column must contain only atomic (indivisible) values. No repeating groups or arrays.
-
How it was achieved:
-
All columns contain single values: e.g.,
StudentName,Email,CourseID. -
There are no multi-valued fields like "Courses = ['Math', 'Physics']".
-
✅ Second Normal Form (2NF) – Full Functional Dependency
-
Rule: The table must be in 1NF, and all non-key attributes must be fully functionally dependent on the entire primary key (not just part of it).
-
How it was achieved:
-
The
Studentstable uses a single-column primary key (StudentID). -
All other attributes in the
Studentstable (e.g.,StudentName,Age,Email,CourseID) depend only onStudentID.
-
✅ Third Normal Form (3NF) – No Transitive Dependency
-
Rule: The table must be in 2NF and no non-key attribute should depend on another non-key attribute (i.e., no transitive dependencies).
-
Problem in unnormalized form:
-
Originally,
Coursewas stored as a text field in theStudentstable. -
This causes transitive dependency:
StudentID → Course, butCourseitself contains meaningful data (e.g., course name), which may relate to other course details.
-
-
How it was fixed:
-
CourseNamewas moved into a new table calledCourses. -
Studentsnow stores onlyCourseIDas a foreign key, which refers to theCoursestable. -
This removes the dependency of
CourseNameonStudentID.
-
🎯 Why 3NF is Important Here
-
Prevents update anomalies (e.g., changing a course name in many rows).
-
Prevents insertion anomalies (e.g., inserting a course before having a student).
-
Prevents deletion anomalies (e.g., deleting a student and accidentally removing course info).
-
Improves data consistency and integrity.
💡 Summary Table
| Normal Form | Rule | Achieved By |
|---|---|---|
| 1NF | Atomic columns, no repeating groups | One value per cell in Students table |
| 2NF | Full dependency on the primary key | All non-key attributes depend on StudentID |
| 3NF | No transitive dependency | Moved CourseName to a separate Courses table |