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:
- It is already in 1NF (no repeating groups, atomic values)
- 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:
Gradedepends on bothStudentIDANDCourseID(full dependency ✓)StudentNamedepends only onStudentID(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.