Normalization is splitting a badly designed table into smaller tables so that every fact is stored exactly once. Repeated facts are what let a database contradict itself, and the normal forms, 1NF to BCNF, are the checklist for removing them.

Below is a course registration sheet like the one your department office keeps. Step through it and watch it break in three different ways.

The registration sheet, and how it breaks

registration_sheet

roll_nobranchhodcoursecreditsfaculty
101CSEMehtaDBMS, OS4, 3Rao, Iyer
102CSEMehtaDBMS4Khan
103ECEPillaiDBMS, Signals4, 4Rao, Das
  • The problem

The sheet as the office first typed it, one row per student. Rows 101 and 103 squeeze two courses, two credit values and two faculty names into single cells.

Step 1 of 5

We will fix this one sheet, one normal form at a time, until every fact lives in exactly one place.

Why normalize: the three anomalies#

The sheet has redundancy, which means the same fact is stored in many rows. "The CSE HOD is Mehta" is stored three times. "DBMS has 4 credits" is also stored three times. Wasted space is the small problem. The big problem is that redundancy lets the data disagree with itself. Textbooks name three kinds of damage:

  • An update anomaly happens when one fact is changed in some copies but not in others (step 3).
  • An insert anomaly happens when you cannot store one fact without also storing an unrelated one. In step 4, a course cannot exist without a student.
  • A delete anomaly happens when deleting one fact also deletes another one you wanted to keep (step 5).

All three have the same root cause. One table is trying to describe several things at once: students, branches, courses and faculty. Normalization finds these hidden things using functional dependencies.

Functional dependencies#

A functional dependency says that if you know the value of one column, you know the value of another. If you know a roll number, you know that student's branch. Roll 101 is CSE in every row where it appears.

We write this as roll_no → branch and read it as "roll_no determines branch". Formally, X → Y holds on a table if any two rows that agree on X also agree on Y. The left side, X, is called the determinant. Either side can be a set of columns.

These are the college's rules for our sheet:

  • roll_no → branch: a student belongs to one branch.
  • branch → hod: each branch has one HOD.
  • course → credits: each course has fixed credits.
  • {roll_no, course} → faculty: a student sits in one section of a course.
  • faculty → course: each faculty member teaches only one course this semester. DBMS has two sections, one taken by Rao and one by Khan.

A dependency is a rule about meaning, so a few rows of data can never prove one. Rows can only disprove one. A dependency like {roll_no, course} → course, where the right side is already inside the left side, is called trivial. It is always true and tells you nothing.

Quick check

Quick check: The five rows of the cleaned sheet (step 2 above) disprove three of these dependencies. Which one survives?

Keys and prime attributes#

Textbooks say relation, attribute and tuple. In this article these are simply table, column and row. A few more terms build on functional dependencies:

  • A superkey is a set of columns that, by the college's rules, can never be the same in two different rows, so it determines every column.
  • A candidate key is a minimal superkey. If you remove any column from it, it stops being a superkey.
  • The primary key is the one candidate key the designer picks.
  • A prime attribute is a column that belongs to at least one candidate key. All other columns are non-prime.

In the cleaned sheet, {roll_no, course} is a candidate key. A student registers for a course once, so the pair can never repeat. Neither half is enough on its own: one student takes many courses (101 appears twice) and one course has many students (DBMS appears three times).

Quick check

Quick check: {roll_no, course} is one candidate key of the cleaned sheet. Using faculty → course, which columns are prime?

First normal form (1NF)#

A table is in first normal form (1NF) if every column holds only atomic values. That means one value per cell, never a list or a set. Step 1 of the first widget broke this rule with "DBMS, OS" in a single cell. Step 2 fixed it by giving each registration its own row, and that is why the key became {roll_no, course}.

Notice that 1NF made the repetition worse: roll 101's branch now appears twice. The next three forms clean that up.

Quick check

Quick check: Someone fixes the original sheet differently, with columns course1, course2 and course3, one course in each. Is the table in 1NF now?

Second normal form (2NF)#

A partial dependency is when a non-prime column depends on only part of a candidate key. A table is in second normal form (2NF) if it is in 1NF and no non-prime column is partially dependent on any candidate key. In other words, every non-prime column needs the whole key.

Quick check

Quick check: The cleaned sheet has key {roll_no, course}. Which of these is a partial dependency?

The fix is to give each partial dependency its own table. Facts that depend on roll_no go to a students table. Facts that depend on course go to a courses table. The original table keeps only the fact that needs the whole key: which faculty the student registered with.

Third normal form (3NF)#

After the 2NF split, the students table holds roll_no → branch and branch → hod. roll_no reaches hod only through branch, and branch is not a key. This is a transitive dependency.

A table is in third normal form (3NF) if it is in 2NF and no non-prime column depends on a candidate key transitively. Korth gives an exact version that we need for BCNF. A table is in 3NF if, for every non-trivial dependency X → A, at least one of these is true:

  • X is a superkey, or
  • A is a prime attribute.

The second condition is an escape clause. Remember it.

Watch both splits on our sheet:

From 1NF to 3NF, one split at a time

registration_sheet

roll_nobranchhodcoursecreditsfaculty
101CSEMehtaDBMS4Rao
101CSEMehtaOS3Iyer
102CSEMehtaDBMS4Khan
103ECEPillaiDBMS4Rao
103ECEPillaiSignals4Das
  • Stored more than once

Key is (roll_no, course). branch and hod depend on roll_no alone, and credits depends on course alone: partial dependencies, and each one repeats.

Step 1 of 4

Every split shares a column that is the key of one piece: roll_no, course or branch. That makes the split lossless: joining the pieces back gives exactly the original rows, with no extra rows.

Boyce-Codd normal form (BCNF)#

A table is in Boyce-Codd normal form (BCNF) if, for every non-trivial dependency X → Y, X is a superkey. This is the 3NF rule with the escape clause ("or A is prime") deleted. So every BCNF table is in 3NF, but not every 3NF table is in BCNF.

Our registrations table still holds faculty → course.

Quick check

Quick check: registrations(roll_no, course, faculty) has candidate keys {roll_no, course} and {roll_no, faculty}, and faculty → course holds. Which is true?

Here is the problem this dependency still causes, and the BCNF fix:

The last repeat: faculty and course

registrations

roll_nocoursefaculty
101DBMSRao
101OSIyer
102DBMSKhan
103DBMSRao
103SignalsDas
  • Stored more than once

Rao teaches only DBMS, yet the pair Rao, DBMS is stored once for every student in her section. Every column here is prime, so the table is already in 3NF.

Step 1 of 4

The last step is the price of BCNF. The rule {roll_no, course} → faculty now spans two tables, so catching a double registration needs a join or a trigger. This is a general result: a BCNF decomposition is always lossless but may not preserve every dependency, while 3NF can always keep both. That is why some designers stop at 3NF.

All four forms at a glance#

FormRule in one lineWhat it removes
1NFEvery cell holds one atomic valueLists inside cells ("DBMS, OS")
2NF1NF, and no non-prime column depends on part of a candidate keyPartial dependencies (course → credits)
3NFFor every non-trivial X → A, X is a superkey or A is primeTransitive dependencies (roll_no → branch → hod)
BCNFFor every non-trivial X → Y, X is a superkeyNon-key determinants of prime columns (faculty → course)

Our final design has five tables: students(roll_no, branch), branches(branch, hod), courses(course, credits), teaches(faculty, course) and registrations(roll_no, faculty). Every one of them is in BCNF.

When to stop: denormalization#

More normal forms exist beyond BCNF. 4NF handles multivalued dependencies and 5NF handles join dependencies, but campus interviews rarely go there. Most real designs aim for 3NF or BCNF. After that, teams sometimes do denormalization: they add redundancy back on purpose so that reads are faster. A placement portal that lists thousands of applications might store the branch in the applications table, so that every page load avoids a join. This is a trade, not a free win. The application now owns the job of keeping the copies in sync, which brings back exactly the update anomaly in step 3 of the first sheet. So normalize first, then denormalize only where a measured query is slow.

Final check#

Quick check

Quick check: The hostel office keeps mess_bills(roll_no, month, hostel, warden, amount). The key is {roll_no, month}. A student stays in one hostel all year, each hostel has one warden, and amount (for example ₹3,200) is the bill for that student and month. What is the highest normal form this table is in?

Next, see how queries put these split tables back together in SQL joins, or why the split pieces stay consistent under concurrent updates in transactions and ACID.