Course contentsShow
← Computer Science
Lesson 1634 of 2,87237. Database Design and NormalizationFree lesson

Second Normal Form (2NF) Definition

Understanding 2NF requirements: must be in 1NF and eliminate partial dependencies on composite keys.

Second Normal Form (2NF) Definition

You'll learn what Second Normal Form requires and why partial dependencies must be eliminated.

Second Normal Form (2NF) builds directly on First Normal Form by addressing a specific problem that arises when we have composite keys (primary keys made up of multiple columns).

The Core Requirements

A table is in 2NF if and only if:

  1. It is already in 1NF (no repeating groups, atomic values)
  2. Every non-key attribute is fully functionally dependent on the entire primary key

The second rule means: no partial dependencies allowed.

What's a Partial Dependency?

A partial dependency occurs when a non-key column depends on only part of a composite primary key, not the whole key.

Example scenario:

Imagine a table tracking student course enrollments:

EnrollmentRecords(StudentID, CourseID, StudentName, Grade)
Primary Key: (StudentID, CourseID)

Here's the problem:

  • Grade depends on both StudentID AND CourseID (full dependency ✓)
  • StudentName depends only on StudentID (partial dependency ✗)

StudentName doesn't need to know which course to determine its value—it only needs StudentID. This violates 2NF.

Why It Matters

Partial dependencies cause:

  • Redundancy: Student names repeat for every course they take
  • Update anomalies: Changing a student's name requires updating multiple rows
  • Insertion anomalies: Can't store a student's name without enrolling them in a course

The Fix

Split the table so every non-key attribute depends on the complete key:

  • Students(StudentID, StudentName)
  • Enrollments(StudentID, CourseID, Grade)

Key Takeaway: Second Normal Form requires 1NF plus elimination of partial dependencies—every non-key attribute must depend on the whole composite key, not just part of it.