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 Students table uses a single-column primary key (StudentID).

    • All other attributes in the Students table (e.g., StudentName, Age, Email, CourseID) depend only on StudentID.


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, Course was stored as a text field in the Students table.

    • This causes transitive dependency: StudentID → Course, but Course itself contains meaningful data (e.g., course name), which may relate to other course details.

  • How it was fixed:

    • CourseName was moved into a new table called Courses.

    • Students now stores only CourseID as a foreign key, which refers to the Courses table.

    • This removes the dependency of CourseName on StudentID.


๐ŸŽฏ 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


Popular posts from this blog

Technology and Innovation by Atul Kalukhe