1. Home
  2. Database Management Systems
  3. Normalization (1NF, 2NF, 3NF)

Normalization (1NF, 2NF, 3NF)

Remove redundancy from tables step by step. Watch one messy table split into clean 1NF, 2NF and 3NF tables in 3D — and see which duplicate values disappear.

Interactive 3DIntermediate14 min readDBMSUpdated

Drag to rotate · Right-drag to pan · Click, then scroll to zoom · Space play · Left arrowRight arrow step

What's happening

Normalisation reorganises tables to remove redundancy and the bugs it causes. We will take one messy table through 1NF → 2NF → 3NF. Press Normalise step by step.

Pseudocode

  1. 1NF: every cell holds ONE atomic value; rows are unique (a primary key exists)
  2. 2NF: 1NF + no PARTIAL dependency
  3. (no non-key column depends on only part of a composite key)
  4. 3NF: 2NF + no TRANSITIVE dependency
  5. (non-key columns depend on the key, the whole key, and nothing but the key)
Read this model as text · 9 steps

One run of the model above, written out step by step. Useful with a screen reader, on a slow connection, or for quick revision. The values may differ from the run on your screen.

  1. Normalisation reorganises tables to remove redundancy and the bugs it causes. We will take one messy table through 1NF → 2NF → 3NF. Press Normalise step by step.
  2. An unnormalised table: the "Courses" cell holds a list of several courses packed into one value. You can’t easily search, sort or update one course.
  3. 1NF: split the list so every cell holds one atomic value — one row per student per course. A single column can no longer identify a row, so the primary key is the pair (StudentID, CourseID).
  4. Find the functional dependencies (A → B means "A decides B"). Name depends only on StudentID; Course, Instructor and Office depend only on CourseID. Each depends on part of the key — a partial dependency.
  5. The result is redundancy (red): "Asha" is stored twice, and DBMS / Rao / B-12 twice. If Rao changes office we must update many rows — miss one and the data contradicts itself (an update anomaly).
  6. 2NF: move each partial dependency into its own table. Students (StudentID → Name), Courses (CourseID → details), and Enrollments just links them. The duplicates disappear.
  7. Still a problem inside Courses: CourseID → Instructor, and Instructor → Office. Office depends on the key only through Instructor — a transitive dependency. Iyer’s office is stored twice.
  8. 3NF: move Instructor → Office into an Instructors table. Now every fact is stored exactly once: each non-key column depends on "the key, the whole key, and nothing but the key".
  9. Nothing was lost: JOINing the four tables rebuilds the original data. Changing Iyer’s office now means updating one cell. (Even stricter forms exist: BCNF, 4NF, 5NF.)

Try this in the 3D model

  • Pause on the 1NF step with red cells. List every fact that is stored twice.
  • Follow the cell "Asha" through every step. How many copies are left at the end?
  • At the transitive-dependency step, explain in your own words why Office does not belong in Courses.

Why normalize?

When the same fact is stored in many places, three kinds of anomalies appear:

  • Update anomaly — change Rao’s office in one row but forget another → contradictory data.
  • Insert anomaly — you can’t record a new course until a student enrolls in it.
  • Delete anomaly — delete the only student in a course and you lose the course’s details too.

Normalization reorganises tables so that every fact is stored once.

Functional dependencies

A → B (“A functionally determines B”) means: if two rows have the same A, they must have the same B. Examples:

  • StudentID → Name
  • CourseID → CourseName, Instructor
  • Instructor → Office

Normal forms are rules about which dependencies are allowed.

The normal forms

First Normal Form (1NF)

  • Every cell holds one atomic value (no lists, no repeating groups).
  • Rows are uniquely identified by a primary key.

Second Normal Form (2NF)

  • In 1NF, and
  • no partial dependency: no non-key column depends on only part of a composite primary key.

Third Normal Form (3NF)

  • In 2NF, and
  • no transitive dependency: no non-key column depends on another non-key column.

A handy summary of 3NF: every non-key attribute must depend on “the key, the whole key, and nothing but the key.”

Worked example

Unnormalised:

StudentID Name Courses
101 Asha C1 DBMS Rao B-12 ; C2 OS Iyer A-03

1NF — one value per cell, key = (StudentID, CourseID):

StudentID Name CourseID Course Instructor Office
101 Asha C1 DBMS Rao B-12
101 Asha C2 OS Iyer A-03
102 Ravi C1 DBMS Rao B-12

Partial dependencies: StudentID → Name, CourseID → Course, Instructor, Office.

2NF — split by what each column depends on:

  • Students(StudentID, Name)
  • Enrollments(StudentID, CourseID)
  • Courses(CourseID, Course, Instructor, Office)

Transitive dependency in Courses: CourseID → Instructor → Office.

3NF:

  • Students(StudentID, Name)
  • Enrollments(StudentID, CourseID)
  • Courses(CourseID, Course, Instructor)
  • Instructors(Instructor, Office)

Every fact now appears exactly once, and a JOIN brings the original view back:

SELECT s.StudentID, s.Name, c.CourseID, c.Course, c.Instructor, i.Office
FROM Students s
JOIN Enrollments e ON e.StudentID = s.StudentID
JOIN Courses c     ON c.CourseID  = e.CourseID
JOIN Instructors i ON i.Instructor = c.Instructor;

Beyond 3NF

  • BCNF (Boyce–Codd): for every dependency X → Y, X must be a superkey. Slightly stricter than 3NF. See BCNF and Lossless Decomposition.
  • 4NF: no multivalued dependencies; 5NF: no join dependencies.

Denormalization

Normalized designs need more joins, which can be slow for read-heavy analytics. Data warehouses sometimes denormalize on purpose (star schemas) — a conscious trade of redundancy for speed.

Common mistakes

  • Thinking 1NF is only about “no duplicate rows” — atomic values matter too.
  • Splitting tables without keeping the keys needed to join them back (a lossy decomposition).
  • Over-normalizing small lookup data where the extra joins aren’t worth it.

Complexity at a glance

Case / operationTimeWhy
Effect on readsMore joinsData is split across tables.
Effect on writesFewer updatesEach fact is stored once.

Quick check

Test yourself — pick an answer to see if you got it.

1. A table has a column "Phone numbers" containing "98100, 98111". Which normal form does it violate?

2. Key (StudentID, CourseID), and StudentName depends only on StudentID. This is a…

3. CourseID → Instructor and Instructor → Office. Office depends on CourseID…

4. What is an update anomaly?

Saved in this browser.
Spotted a mistake or a bug in the 3D model?

Report a mistake

in Normalization (1NF, 2NF, 3NF). Thank you — every report makes the lesson better for the next reader.

We'll also include a link to the step of the 3D model you're on and your browser type, so we can reproduce it.