Normalization to Third Normal Form Guide
Normalization to Third Normal Form Guide
The minimal normal form a relation must satisfy is the first normal form (1NF). A relation is in 1NF if all its attributes contain only atomic, indivisible values with no repeating groups or arrays, meaning each column consists of separate and unique data .
In normalizing tables to 3NF, the primary key is a unique identifier for each record. An alternate key is any candidate key that is not chosen as the primary key. Foreign keys are fields in a table that create a link between two tables, referencing the primary key in another table. Correctly identifying these keys is crucial for maintaining data integrity and ensuring reduced redundancy—critical when breaking down tables to remove partial and transitive dependencies .
A transitive dependency occurs when a non-key attribute depends on another non-key attribute, rather than directly on the primary key. In 3NF, no transitive dependencies can exist; every non-key attribute must rely solely on the primary key. For example, in a table with attributes StudentID, InstructorName, and InstructorAddress, if InstructorAddress depends on InstructorName rather than StudentID, a transitive dependency is present. Removing such dependencies by splitting tables ensures compliance with 3NF .
A table violates 1NF if it contains repeating groups, which occur when there are multiple values for a particular column in a single record or row. To transform a table to comply with 1NF, each field must contain only atomic, indivisible units of data. This is achieved by removing repeating groups and creating separate rows for each instance of the repeated data. For example, if a table has a column that stores multiple phone numbers for a single branch, to transform it to 1NF, separate rows would be added for each phone number, or a related table should be created with a foreign key relationship .
The sample branch office table does not conform to 1NF because it allows multiple telephone numbers in a single field, representing repeating groups. To normalize this into 3NF, first, the table should be split so that each phone number is stored in a separate row in a related table. Additionally, each non-key attribute should depend solely on the primary key. The third normal form further requires eliminating transitive dependencies, so any indirect relationships among non-key attributes need separate tables, ensuring only direct relationships with the primary key remain .
To normalize a Student_Grade_Report table into 3NF, first ensure it is in 1NF and 2NF. Then eliminate any transitive dependencies by separating attributes into distinct tables based on functional dependencies. For example, attributes like InstructorNo, InstructorName, and InstructorLocation should be in a separate Instructor table linked by a foreign key from the main table, which should contain only attributes directly related to StudentNo such as Grade. This reorganization eliminates redundancies and enhances data consistency and integrity .
A table is in second normal form (2NF) if it satisfies the conditions for 1NF and all non-key attributes are fully functionally dependent on the entire primary key. This means there are no partial dependencies of columns on composite primary keys. Each attribute must rely on the whole key, ensuring reduced redundancy and dependence on unique keys .
Transitioning from 2NF to 3NF requires the elimination of transitive dependencies. A table is in 3NF if it is in 2NF and all its attributes are non-transitively dependent on the primary key, which means there are no dependencies among non-key attributes. The purpose of this step is to prevent anomalies and ensure data integrity by excluding extraneous dependencies that could cause data updates leading to inconsistent records .
Full functional dependency exists when an attribute is only dependent on the entire primary key and not on any part of it. In relation to 2NF, a table achieves 2NF when all non-key attributes show full functional dependency on the primary key. For example, in a table with a composite primary key of (StudentID, CourseID), if Grade depends on both StudentID and CourseID and not just one of them, then Grade has a full functional dependency, satisfying the conditions necessary for 2NF .
To transition a 1NF table to a 2NF table, each partial dependency must be removed. This involves ensuring that all non-key attributes are fully functionally dependent on the entire primary key rather than just a part of it. The process includes identifying and eliminating partial dependencies by creating new tables for them and providing foreign keys to maintain data relationships. The result is that each table fulfills the condition that every non-key column is fully dependent on the primary key, eliminating redundancy associated with partial dependencies .