Technology Encyclopedia Home >What is the third normal form in database principles?

What is the third normal form in database principles?

The Third Normal Form (3NF) is a database normalization principle that builds upon the First Normal Form (1NF) and Second Normal Form (2NF). A table is in 3NF if it meets the following two conditions:

  1. It is in 2NF (which means it is already in 1NF and has no partial dependencies).
  2. All non-key attributes are only dependent on the primary key and not on any other non-key attributes (i.e., there are no transitive dependencies).

A transitive dependency occurs when a non-key attribute depends on another non-key attribute, rather than directly on the primary key. 3NF eliminates such dependencies to reduce data redundancy and improve data integrity.

Example:

Consider a table Employees with the following columns:

  • EmployeeID (Primary Key)
  • Name
  • DepartmentID
  • DepartmentName

Here, DepartmentName depends on DepartmentID, which in turn depends on EmployeeID. This creates a transitive dependency (EmployeeID → DepartmentID → DepartmentName).

To normalize this to 3NF, we split the table into two:

  1. Employees (EmployeeID, Name, DepartmentID)
  2. Departments (DepartmentID, DepartmentName)

Now, DepartmentName depends only on DepartmentID, and there are no transitive dependencies.

Relevance in Cloud Databases

When designing scalable and efficient cloud-based relational databases, adhering to 3NF helps optimize storage and query performance. Tencent Cloud’s Relational Database Service (TencentDB for MySQL/PostgreSQL/SQL Server) supports normalized database structures, ensuring data consistency and reducing redundancy in distributed environments. Using 3NF-compliant designs in Tencent Cloud databases improves maintainability and scalability for enterprise applications.