Database Management System (DBMS) / Normalization in DBMS

2NF

📘 What is 2NF (Second Normal Form)?

A table is in 2NF if:

  1. It is already in 1NF

  2. Every non-prime attribute is fully functionally dependent on the entire primary key


🧠 What is a Partial Dependency?

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


🧾 Example (Table in 1NF, but not in 2NF):

Let’s say we have this table:

🎓 Student_Course Table:

Student_ID

Course

Student_Name

Department

101

DBMS

Swati

CS

101

OS

Swati

CS

102

AI

Ravi

IT

✅ Primary Key = (Student_ID, Course)

❌ Student_Name and Department only depend on Student_ID, not the full key (Student_ID, Course)

➡️ This is a partial dependency — hence not in 2NF.

🔑 2NF Only Matters When:

  • The table has a composite primary key

  • There are partial dependencies


🧠 Key Concepts Recap:

Concept

In 2NF?

Atomic values

✅ Yes (inherited from 1NF)

No repeating groups

✅ Yes

No partial dependency

✅ Yes

Full dependency on PK

✅ Yes


⚠️ Why Use 2NF?

  • Eliminates partial dependency

  • Reduces data duplication

  • Prevents update and insertion anomalies