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 · ←→ step

What's happening

Pseudocode

    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.
    • 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 only in this browser — no account needed.
    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.