Second Normal Form (2NF)
Press Next → or use ← → arrow keys
The Story — The Tidy Table That Still Lied
A table is in 2NF if it's in 1NF and every non-key column depends on the entire primary key — never merely on part of it. Removing those partial-key dependencies is the whole job of 2NF.
A Quick Recap of 1NF — and Its Catch
Making STUDENT(Roll, Phone, Name) atomic forces the key to become {Roll, Phone} — so the student's Name repeats on every phone row. That leftover repetition is exactly what 2NF resolves.
Partial Dependency & Its Three Anomalies
A partial dependency is when a non-prime attribute depends on only part of a composite key. One flaw → three classic anomalies.
| Stu_ID | Crs_ID | Stu_Name | Crs_Name |
|---|---|---|---|
| S1 | C1 | Raj | DBMS |
| S1 | C2 | Raj | Maths |
| S2 | C1 | Sara | DBMS |
What Is Second Normal Form?
A partial dependency needs a composite key. If the primary key is a single attribute, there's no "part" to depend on — so any 1NF table with a single-column key is automatically in 2NF.
Prime = belongs to some candidate key; non-prime = belongs to none. 2NF forbids the pattern (part of key) → (non-prime attribute).
A Table That Fails 2NF — Full vs Partial
ENROLLMENT is in 1NF (atomic) but not in 2NF. PK = {Student_ID, Course_ID}. Watch which columns depend on only half the key.
Student_Name depends only on Student_ID and Course_Name only on Course_ID — both partial (violate 2NF). Only Marks depends on the whole key — that one's fine.
Convert to 2NF — One Table Splits Into Three
STUDENT
| ID | Name |
|---|---|
| S1 | Raj |
| S2 | Sara |
COURSE
| ID | Name |
|---|---|
| C1 | DBMS |
| C2 | Maths |
ENROLLMENT
| S | C | Mk |
|---|---|---|
| S1 | C1 | 80 |
| S1 | C2 | 75 |
| S2 | C1 | 90 |
Every Column Now Depends on Its Whole Key
| Attribute | Depends on | Verdict |
|---|---|---|
| Student_Name | Student_ID (its full key) | Full ✓ |
| Course_Name | Course_ID (its full key) | Full ✓ |
| Marks | {Student_ID, Course_ID} | Full ✓ |
"Raj" lives once in STUDENT and "DBMS" once in COURSE. Rename a course in one place · add a course with no students enrolled · delete an enrolment without erasing the course. And the split is lossless — rejoin on the shared keys and you get the original back exactly.
Two Lenses on 2NF
OLTP systems normalize to 2NF+ to keep inserts/updates safe. Analytics (OLAP) systems sometimes deliberately reintroduce redundancy to avoid expensive joins — an intentional trade-off, never an accident.
The 2NF Verification Checklist
Decomposition must stay lossless — keep the shared column as a foreign key so the tables can rejoin without losing the relationship.
Three Common Mistakes
Composite key? For each non-prime column ask: "does it need both key parts, or just one?" Just one → move it out.
Golden Rules of Second Normal Form
One Fact, One Place
2NF makes every non-key column depend on its whole key — killing the redundancy and the three anomalies 1NF left behind, all via a lossless split linked by foreign keys. But one gap remains: a non-key column can still depend on another non-key column. Removing that transitive dependency is the next step — Third Normal Form (3NF).
If a non-key column depends on only part of a composite key, split it out — 2NF means every non-key attribute depends on the whole key, nothing less.
🧹 End of tutorial · Press ← to review, or click Restart