Hello! In our previous lesson, we explored the concept of transitive dependencies and practiced identifying them in various table structures. You learned that these indirect dependencies can cause data anomalies, just like the partial dependencies we tackled earlier.
This lesson builds directly on that knowledge. We will now formally define the requirements for a table to be in Third Normal Form (3NF). By the end of this lesson, you will be able to state the precise conditions a table must meet to be considered fully normalized up to this crucial level, which is a key objective for your upcoming project and exam.
1. The Core Requirements for 3NF
A table's journey through normalization is a cumulative process. To be in 2NF, it must first be in 1NF. Similarly, to achieve 3NF, a table must already satisfy the rules of 2NF. 3NF then adds one final, critical rule.
Let's get a clear definition of these requirements from a helpful guide.
What is Third Normal Form (3NF)? A Beginner-Friendly Guide
This article from DataCamp provides a straightforward explanation of 3NF and its conditions.
Read the introduction under the heading "Third Normal Form (3NF) Definition" and then focus on the two bullet points under the heading "Understanding the Conditions for Third Normal Form".
As the article states, the two conditions for a table to be in 3NF are:
- The table must be in Second Normal Form (2NF). This means all its data values are atomic (1NF), and it has no partial dependencies. In other words, every non-key attribute must be fully dependent on the entire primary key.
- The table must have no transitive dependencies. This is the new rule for 3NF. It ensures that no non-key attribute is dependent on another non-key attribute.
These two rules work together to enforce the principle that every non-key attribute in a table must depend directly and exclusively on the primary key.
2. A More Formal Definition of 3NF
While the two rules above are the most common way to define 3NF, database theory also provides a more formal definition based on functional dependencies. Understanding this will give you a more precise, academic perspective, which is valuable in a university setting.
This formal definition states that for a table to be in 3NF, for every non-trivial functional dependency of the form , one of the following two conditions must hold:
- is a superkey.
- is a prime attribute (meaning, each attribute that makes up is part of at least one candidate key).
Let's read about this formal definition and then break it down.
Third Normal Form (3NF) - GeeksforGeeks
This article from GeeksforGeeks presents the formal conditions for 3NF.
Read the two bullet points under the heading "Conditions for a Table to be in 3NF".
Let's connect this back to what we already know. A transitive dependency, as we learned in the last lesson, often has the form PK -> NonKey1 -> NonKey2.
The problematic dependency is NonKey1 -> NonKey2. Let's check this against the formal rules:
- Is
NonKey1(our ) a superkey? No. - Is
NonKey2(our ) a prime attribute? No.
Since this dependency fails to meet either condition, it violates the formal definition of 3NF. This shows that the rule "no transitive dependencies" is just a more practical way of stating this formal condition.
3. Comparing the Normal Forms
At this point, you've learned the rules for 1NF, 2NF, and 3NF. It's helpful to see them side-by-side to understand how they build upon one another. The goal of this progression is to progressively eliminate dependencies that cause data anomalies.
The following resource provides a simple table that summarizes the requirements for each normal form.
Comparison: First, Second, Third, and BC Normal Forms
This section of the DataCamp article contains a very useful comparison table.
Find the heading "Comparison: First, Second, Third, and BC Normal Forms" and study the table directly below it. (You can ignore the text about BCNF for now, as it's outside the scope of your current goal).
This table provides a concise summary:
| Feature | 1NF | 2NF | 3NF |
|---|---|---|---|
| Atomic data | ✅ | ✅ | ✅ |
| No partial dependencies | ❌ | ✅ | ✅ |
| No transitive dependencies | ❌ | ❌ | ✅ |
This progression leads us back to the memorable phrase for database designers: "Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key."
- "The key" (atomic values) gets you to 1NF.
- "The whole key" (eliminating partial dependencies) gets you to 2NF.
- "Nothing but the key" (eliminating transitive dependencies) gets you to 3NF.
This phrase is an excellent way to remember the purpose and requirements of each of the first three normal forms.
Conclusion
In this lesson, we have formally defined the requirements for a table to be in Third Normal Form. You now have both a practical and a formal understanding of the rules that govern this important stage of database normalization.
Key Takeaways:
- A table is in 3NF if it meets two conditions:
- It is already in 2NF.
- It contains no transitive dependencies.
- Formally, this means for any functional dependency , either must be a superkey or must be a prime attribute.
- The progression from 1NF to 3NF systematically removes dependencies, ensuring that all non-key attributes depend on "the key, the whole key, and nothing but the key."
Now that you can confidently state the rules for 3NF, our next lesson will focus on applying them. We will look at several tables and practice identifying whether they violate 3NF.