0% found this document useful (0 votes)
6 views4 pages

Database Normalization Process Explained

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Database Normalization Process Explained

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Normalization Example

We will use the Student_Grade_Report table below, from a School


database, as our example to explain the process for Normalization.

Student_Grade_Report (StudentNo, StudentName, Major, CourseNo,


CourseName, InstructorNo, InstructorName, InstructorLocation, Grade)

Figure 1 Dependency diagram

The abbreviations used in Figure1 are as follows:

 PD: partial dependency


 TD: transitive dependency
 FD: full dependency (Note: FD typically stands for functional
dependency. Using FD as an abbreviation for full dependency is only
used in Figure1)

First Normal Form (1NF)


In the first normal form, only single values are permitted at the
intersection of each row and column; hence, there are no repeating
groups.

To normalize a relation that contains a repeating group, remove the


repeating group and form two new relations.

The PK of the new relation is a combination of the PK of the original


relation plus an attribute from the newly created relation for unique
identification.
We will use the Student_Grade_Report table below, from a School
database, as our example to explain the process for 1NF.

Student_Grade_Report (StudentNo, StudentName, Major, CourseNo,


CourseName, InstructorNo, InstructorName, InstructorLocation, Grade)
In the Student Grade Report table, the repeating group is the course
information

 Remove the repeating group. In this case, it’s the course information
for each student.
 Identify the PK for your new table.
 The PK must uniquely identify the attribute value (StudentNo and
CourseNo).
 After removing all the attributes related to the course and student, you
are left with the student course table (StudentCourse).
 The Student table (Student) is now in first normal form with the
repeating group removed.
 The two new tables are shown below.

Student (StudentNo, StudentName, Major)


StudentCourse (StudentNo, CourseNo, CourseName, InstructorNo,
InstructorName, InstructorLocation, Grade)

Second Normal Form (2NF)


For the second normal form, the relation must first be in 1NF. The
relation is automatically in 2NF if, and only if, the PK comprises a single
attribute.

If the relation has a composite PK, then each non-key attribute must be
fully dependent on the entire PK and not on a subset of the PK (i.e., there
must be no partial dependency or augmentation).

To move to 2NF, a table must first be in 1NF.

Process for 2NF

 The Student table is already in 2NF because it has a single-column


PK.
 When examining the Student Course table, we see that not all the
attributes are fully dependent on the PK; specifically, all course
information. The only attribute that is fully dependent is grade.
 Identify the new table that contains the course information.
 Identify the PK for the new table.
 The three new tables are shown below.

Student (StudentNo, StudentName, Major)


CourseGrade (StudentNo, CourseNo, Grade)
CourseInstructor (CourseNo, CourseName, InstructorNo,
InstructorName, InstructorLocation)

Third Normal Form (3NF)


To be in third normal form, the relation must be in second normal form.
Also all transitive dependencies must be removed; a non-key attribute
may not be functionally dependent on another non-key attribute.

Process for 3NF

 Eliminate all dependent attributes in transitive relationship(s) from


each of the tables that have a transitive relationship.
 Create new table(s) with removed dependency.
 Check new table(s) as well as table(s) modified to make sure that
each table has a determinant and that no table contains inappropriate
dependencies.
 See the four new tables below.

Student (StudentNo, StudentName, Major)


CourseGrade (StudentNo, CourseNo, Grade)
Course (CourseNo, CourseName, InstructorNo)
Instructor (InstructorNo, InstructorName, InstructorLocation)

At this stage, there should be no anomalies in third normal form.


Boyce-Codd Normal Form (BCNF)
Student (StudentNo, StudentName, Major)

CourseGrade (StudentNo, CourseNo, Grade)


Course (CourseNo, CourseName, InstructorNo)
Instructor (InstructorNo, InstructorName, InstructorLocation)
These relations in BCNF; every determinant is a key.

Common questions

Powered by AI

A transitive dependency occurs when a non-key attribute depends on another non-key attribute rather than directly on the primary key. This indirect dependency can lead to data anomalies and redundancy. Removing transitive dependencies in Third Normal Form (3NF) ensures that all non-key attributes are directly dependent on the primary key, thereby improving structural integrity and reducing anomalies .

Unnormalized relations can lead to anomalies such as update, insertion, and deletion anomalies. For instance, repeated data can cause inconsistency during updates and anomalies in data integrity. Normalization addresses these issues by structuring data in such a way that redundant data is removed, and dependencies are simplified, ensuring stable and consistent data storage and retrieval .

While Third Normal Form (3NF) removes transitive dependencies, Boyce-Codd Normal Form (BCNF) requires that every determinant is a candidate key, thus addressing any remaining anomalies related to functional dependencies. BCNF is a stricter version of 3NF and is concerned with ensuring full functional dependency where non-trivial dependencies involve candidate keys only .

Transforming from Second Normal Form (2NF) to Boyce-Codd Normal Form (BCNF) involves ensuring that every determinant is a candidate key. This transformation is significant as it addresses any anomalies left by functional dependencies that involve non-candidate keys even after achieving 3NF. This provides a robust structure ensuring that no dependencies exist between non-key attributes, thereby further optimizing database integrity and consistency .

To achieve Third Normal Form (3NF), a table must first satisfy Second Normal Form (2NF). This requires eliminating all transitive dependencies, meaning that no non-key attribute should be functionally dependent on another non-key attribute. The steps include removing dependent attributes in transitive relationships, creating new tables for these attributes, and ensuring that each table has a determinant without containing inappropriate dependencies .

The dependency diagram visually represents the relationships and dependencies within a database table, distinguishing between partial, full (or functional), and transitive dependencies. This aids in identifying which attributes depend on other attributes and is crucial for understanding how to decompose tables into different normal forms to reduce redundancy and maintain data integrity .

Attributes violate Second Normal Form (2NF) if they are not fully dependent on a composite primary key, meaning they depend only on a part of the key (partial dependency). To address these violations, the attributes must be moved to a new table where their dependency is on a single complete key, ensuring each non-key attribute is fully functionally dependent on the entire primary key .

Primary keys are crucial in database normalization as they uniquely identify records in a table, ensuring data integrity. During normalization, primary keys help in structuring tables to remove partial and transitive dependencies, guiding how tables should be broken down and reorganized to achieve higher normal forms while maintaining relationships between data .

A table must be in First Normal Form (1NF) to ensure that each column value is atomic, thereby eliminating repeating groups. This forms the foundational structure upon which subsequent normal forms are built, as it ensures that data is structured in a way that allows for the removal of partial and transitive dependencies in Second and Third Normal Forms, respectively .

Splitting a relation into multiple tables during normalization reduces data redundancy and ensures that each table contains data about only one entity or subject. This promotes data integrity, simplifies updates, and improves efficiency by ensuring that operations only involve relevant data, reducing the chances of anomalies and the need for complex joins in queries .

You might also like