The Third Normal Form (3NF) is a stage in database normalization aimed at minimizing redundancies and ensuring data integrity. A relation (table) is in Third Normal Form if it satisfies the following conditions:
-
The relation is in Second Normal Form (2NF):
- This means the relation is in First Normal Form (1NF) (all attribute values are atomic, no repeating groups).
- All non-key attributes are fully functionally dependent on the entire primary key, not just part of it.
-
No transitive dependencies:
- No non-key attribute depends transitively on a candidate key. This means a non-key attribute should not depend on another non-key attribute.
In detail, for a relation RR to be in 3NF, for every non-key attribute AA and every candidate key KK in RR, the following condition must be met:
If A depends on K, then A should depend directly on K and not through another attribute B that itself depends on K.
Example:
Suppose we have a Students
table with the following attributes:
Student_ID
(Primary Key)
Name
Course_ID
Course_Name
Instructor
In this table, the attributes Course_Name
and Instructor
might depend on Course_ID
, not directly on Student_ID
. This is an example of a transitive dependency because:
Student_ID
→ Course_ID
Course_ID
→ Course_Name
, Instructor
To convert this table to 3NF, we eliminate transitive dependencies by splitting the table. We could create two tables:
-
Students
:
Student_ID
(Primary Key)
Name
Course_ID
-
Courses
:
Course_ID
(Primary Key)
Course_Name
Instructor
Now, both tables are in 3NF because each non-key attribute depends directly on the primary key and there are no transitive dependencies.
By achieving Third Normal Form, data consistency is increased, and redundancies are reduced, which improves the efficiency of database operations.