Second Normal Form: 2NF

A table is in Second Normal Form if: (1) it is already in 1NF, and (2) it has no partial dependency.

What is a partial dependency?

A partial dependency occurs when a non-key attribute depends on only part of a composite primary key.
For a given table (X, Y, Z, W)
the primary key is composite → (X, Y)

Partial dependency occurs if,
  X → Z  or
  Y → W
That is, the non-key attributes Z and W are partly dependent on / uniquely identified by only part of the primary key — either X or Y.
Corollary worth a mark: if the primary key is a single attribute, a partial dependency is impossible — so any 1NF table with a single-attribute key is automatically in 2NF.

Example

Student_IDCourse_IDStudent_NameCourse_TitleGrade
101CSE101RahimDatabaseA
101CSE102RahimProgrammingB
102CSE101KarimDatabaseA

Primary key for this table is: (Student_ID, Course_ID)

Functional dependencies are:

Student_ID → Student_Name
Course_ID → Course_Title
(Student_ID, Course_ID) → Grade
Here,
  • Student_Name depends only on Student_ID, not on the full primary key.
  • Course_Title depends only on Course_ID, not on the full primary key.
Partial Dependency → so this table is not in 2NF.

Solution — break the table based on functional dependency

Student Table

Student_IDStudent_Name
101Rahim
102Karim

PK = Student_ID

Course Table

Course_IDCourse_Title
CSE101Database
CSE102Programming

PK = Course_ID

Enrollment Table

Student_IDCourse_IDGrade
101CSE101A
101CSE102B
102CSE101A

PK = (Student_ID, Course_ID)

Now all non-key attributes fully depend on the whole primary key, so the design is in 2NF. Notice the mechanical rule: each FD becomes its own table, with the determinant as that table’s primary key.

The method, step by step

1. Identify the primary key — is it composite?
if not, the table is already in 2NF
2. List every functional dependency
3. Mark any FD whose determinant is only PART of the key
these are the partial dependencies
4. Move each such FD into its own table (determinant = PK)
5. What remains keeps the composite key + the fully dependent attributes
Decomposition by functional dependency — the same procedure works for 3NF and BCNF.

Next: Third Normal Form →