Loading Page Content...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
A table in Second Normal Form (2NF) has eliminated partial dependencies. However, data redundancy and update anomalies can still persist if non-key columns depend on other non-key columns. The Third Normal Form (3NF) eliminates these Transitive Dependencies.
As the famous computer science proverb states:
A Transitive Dependency occurs when attribute A determines attribute B, and attribute B determines attribute C:
Because A -> B and B -> C, attribute C is transitively dependent on A through B. Non-key column C does not depend directly on the primary key!
A table is in Third Normal Form (3NF) if and only if:
Consider an employee table with a single primary key (emp_id):
emp_id -> dept_id: Valid! Knowing an employee determines their department ID.dept_id -> dept_name, dept_building: Valid! Knowing a department ID determines its name and building.emp_id -> dept_name is a Transitive Dependency!dept_name nor dept_building are candidate keys. They depend directly on dept_id, which is a non-key column in this table!To satisfy 3NF, remove the transitively dependent attributes and place them in their own independent master table:
Now:
departments.unit_price, quantity, and total_price = unit_price * quantity) technically violates 3NF because total_price depends on other non-key columns! Calculate totals dynamically in queries, or use MySQL 8.0 Generated Columns (GENERATED ALWAYS AS (unit_price * quantity) STORED).order_id (PK), customer_id, and customer_city, why does customer_city violate 3NF?total_cost column alongside quantity and unit_price technically violate 3NF?Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
| Previous Lesson | Next Lesson |
|---|---|
| Second Normal Form (2NF) & Functional Dependencies | Denormalization Strategies & Performance Trade-offs |
Test your understanding of this lesson with 5 questions. Each question has one correct answer.