Welcome back! In our previous lesson, we focused on identifying violations of the Third Normal Form (3NF). You learned to spot transitive dependencies by asking if any non-key attribute could be determined by another non-key attribute, breaking the rule of depending on "nothing but the key."
In this lesson, we will move from diagnosis to resolution. You will learn the practical steps to convert a table that is in Second Normal Form (2NF) into a set of tables that comply with 3NF. This involves systematically eliminating the transitive dependencies we practiced finding. Mastering this process is crucial for creating robust and efficient database designs, which will be a key skill for your upcoming project.
1. The Method: Decomposing to Remove Transitive Dependencies
The process of achieving 3NF from a 2NF table involves breaking down, or decomposing, the table. The goal is to isolate the transitive dependency in its own table, ensuring that all attributes in the remaining tables are fully dependent only on their primary key.
Here is the step-by-step procedure:
- Identify the Transitive Dependency: Start with your 2NF table. Find the chain of dependencies where the primary key determines a non-key attribute, which in turn determines another non-key attribute. If your primary key is
A, and you have non-key attributesBandC, the transitive dependency is the link . - Create a New Table: Create a new table specifically for the transitive dependency. Move both the determinant (
B) and the dependent attribute (C) into this new table. - Assign the Primary Key: In the new table, the determinant attribute (
B) becomes the primary key. - Clean Up the Original Table: Remove the transitively dependent attribute (
C) from the original table. The attributeBremains in the original table, where it now serves as a foreign key linking to the new table you just created.
This process transforms an indirect relationship into two direct ones, as illustrated below.

2. A Step-by-Step Example
Let's apply this method to a concrete example. The document below describes how to normalize a BranchManager table that is not in 3NF.
NORMALIZATION NOTE & EXERCISES (Up to 3NF)
This document provides a worked example of resolving a 3NF violation.
Find "Question 10" in the document. Focus on the BranchManager table example. Read the answer provided, which shows why the table is not in 3NF and illustrates how it is decomposed into two new tables, Branch and ManagerStaff.
Let's break down the process described in the document:
Initial Table (violates 3NF):BranchManager(branchNo, branchAddress, telNo, mgrStaffNo, name)
- Primary Key:
branchNo - Dependencies:
branchNo→branchAddress,telNo,mgrStaffNomgrStaffNo→name(This is the transitive dependency!)
Decomposition Steps:
- Identify: The transitive dependency is
mgrStaffNo→name. The manager's name depends on their staff number, not on the branch number. - Create New Table: Create a new table to hold the facts about the manager. We'll call it
ManagerStaff. It will containmgrStaffNoandname.ManagerStaff(mgrStaffNo, name)
- Assign Primary Key: In the
ManagerStafftable,mgrStaffNobecomes the primary key. - Clean Up Original Table: Remove the
nameattribute from the originalBranchManagertable. ThemgrStaffNoattribute remains to serve as a foreign key. The original table is now better namedBranch.
Final 3NF Tables:
Branch(branchNo, branchAddress, telNo, mgrStaffNo)branchNois the PK.mgrStaffNois a FK referencingManagerStaff.
ManagerStaff(mgrStaffNo, name)mgrStaffNois the PK.
Now, all attributes in each table depend only on their respective primary keys. We have successfully removed the transitive dependency and achieved 3NF.
3. Visualizing the Transformation
Seeing a few more examples can help solidify the concept. The following short video clips demonstrate the decomposition process for different scenarios we discussed in the last lesson.
This video from Saghir School shows the "before" and "after" of removing transitive dependencies.
Watch how the tables are broken down in these three quick examples: Student Exams: See how the Maximum Marks are moved into a separate table based on Exam Type. Cricket Matches: Observe the Capacity being separated into a new table determined by Ground. Employee Salaries: Notice how Salary is moved into a table linked by Designation.
Each of these examples follows the same pattern: the transitively dependent attribute is removed and placed in a new table where its determinant becomes the primary key.
4. Practice Exercise: Your Turn
In the last lesson, you analyzed an INVOICE table and found the transitive dependency VEND_CODE → VEND_NAME. To focus purely on the 3NF step, let's assume we have already created a PRODUCT table from that scenario which is in 2NF but not 3NF.
Starting Table (2NF):PRODUCT(PROD_NUM, PROD_LABEL, VEND_CODE, VEND_NAME)
- Primary Key:
PROD_NUM - Transitive Dependency:
VEND_CODE→VEND_NAME
Your task is to convert this 2NF PRODUCT table into a set of 3NF tables. Follow the four-step decomposition process. What do your final tables look like? What are their primary and foreign keys?
Click to reveal the solution
- Identify: The transitive dependency is
VEND_CODE→VEND_NAME. - Create a New Table: We'll create a
VENDORtable to store vendor information. It will containVEND_CODEandVEND_NAME.VENDOR(VEND_CODE, VEND_NAME)
- Assign Primary Key: In the
VENDORtable,VEND_CODEis the primary key. - Clean Up Original Table: We remove
VEND_NAMEfrom thePRODUCTtable.VEND_CODEremains as a foreign key.
Final 3NF Tables:
PRODUCT(PROD_NUM, PROD_LABEL, VEND_CODE)- Primary Key:
PROD_NUM - Foreign Key:
VEND_CODE(referencesVENDOR)
- Primary Key:
VENDOR(VEND_CODE, VEND_NAME)- Primary Key:
VEND_CODE
- Primary Key:
This new structure correctly separates facts about products from facts about vendors, eliminating the anomalies caused by the transitive dependency.
5. A Complete Normalization Walkthrough
So far, we have focused on the specific step of moving from 2NF to 3NF. This final video puts everything together, showing the entire process of taking a single, unnormalized table all the way to 3NF.
Normalization Practice Exercise | Third Normal Form| Denormalization
This video from Tech Coach provides a complete practice exercise, starting with a denormalized table.
Watch the video to see the full normalization sequence in action. Moving to 2NF: First, observe how the initial table is decomposed to remove partial dependencies, resulting in a set of 2NF tables. This is a good review of the previous module's topic. Moving to 3NF: Next, watch as the presenter identifies a transitive dependency in one of the 2NF tables and performs a final decomposition to achieve 3NF. This directly reinforces what we've learned today.
This exercise demonstrates that normalization is a sequential process. You first ensure 1NF, then resolve partial dependencies to get to 2NF, and finally resolve transitive dependencies to get to 3NF.
Conclusion
In this lesson, you learned the practical skill of converting a 2NF table into a set of 3NF tables. By systematically identifying and removing transitive dependencies, you can create a database structure that is less redundant, more flexible, and free from the update, insertion, and deletion anomalies we've discussed.
Key Takeaways:
- Converting a 2NF table to 3NF is done by decomposing the table to remove transitive dependencies.
- The process involves creating a new table for the transitive dependency, where the determinant becomes the new primary key.
- The transitively dependent attribute is removed from the original table, and the determinant remains as a foreign key to link the tables.
- This procedure ensures that every non-key attribute in every table depends on "the key, the whole key, and nothing but the key."
You have now covered all the fundamental stages of normalization up to 3NF. In the next lesson, we will synthesize everything you've learned. We will take a complex, unnormalized dataset, perform all the normalization steps to achieve 3NF, and then construct a complete ERD to represent the final, well-designed database schema.