III.1.4. Third Normal Form

A table in third normal form must be in the second normal form and every non-primary key column must be non-transitively (or directly) dependent on only the primary key. In other words, if any non-primary key columns are directly dependent on other non-primary key columns, then the table isn't in the third normal form.

The difference between the second normal form and the third normal form is sometimes lost on people learning about normal forms for the first time. The biggest difference is that the second normal form focuses on the primary key as a composite key and requires non-primary key columns to be dependent on the whole primary key, not just a part of it. The third normal form states that non-primary key columns must be dependent on the primary key and not other non-primary key columns. That is, columns must be dependent on the whole key (second normal form) and nothing but the key (third normal form).

Consider Figure 1-5, which isn't in the third normal form because of the CustomerPhone column. The CustomerPhone column is directly dependent on the CustomerName column for meaning. Because this customer placed this order, then the phone number is indirectly associated with the primary key of OrderID, showing a transitive relationship between the CustomerPhone and the OrderID.

Figure III.1-5. An Orders table that isn't compliant with the third ...

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.