SQL Server Interview Question #163

What is Second Normal Form (2NF)?

Database Design, Normalization & Advanced SQL Senior Advanced

Quick Interview Answer

Second Normal Form requires the table to be in 1NF and requires every non-key attribute to depend on the whole candidate key rather than only part of a composite key. This issue is mainly relevant when a key contains multiple columns. For example, if an OrderItems table has a composite key of OrderId and ProductId, ProductName depends only on ProductId rather than the whole composite key and normally belongs in Products.

Detailed Explanation

Second Normal Form requires the table to be in 1NF and requires every non-key attribute to depend on the whole candidate key rather than only part of a composite key.

This issue is mainly relevant when a key contains multiple columns. For example, if an OrderItems table has a composite key of OrderId and ProductId, ProductName depends only on ProductId rather than the whole composite key and normally belongs in Products.