Normalization

DBMS ยท 11 interview questions

Normalization is the process of restructuring tables to remove redundancy, so that a fact is stored in exactly one place. The motivation is update anomalies: if a department's name appears on every employee row, renaming it means updating many rows, and missing one leaves the database contradicting itself.

The forms build on each other. First normal form requires atomic values. Second removes partial dependencies on part of a composite key. Third removes transitive dependencies, where a non-key attribute determines another non-key attribute. Boyce-Codd tightens third form by requiring that every determinant be a candidate key.

Two honest caveats interviewers like. BCNF is not always achievable while also preserving all functional dependencies โ€” sometimes you must choose between the two. And normalization is a default, not a law: reporting systems routinely denormalize on purpose, trading write complexity for read speed.

Normalization interview questions

What problem does normalization actually solve?
Update anomalies caused by redundancy. If a fact is stored in many rows, an update must touch all of them; miss one and the database now holds two contradictory answers. Normalization ensures each fact lives in exactly one place.
Why they ask: Answering with the anomalies rather than 'it removes redundancy' shows you know why redundancy is bad.
What is first normal form?
Every column holds a single atomic value โ€” no lists, no repeating groups like phone1/phone2/phone3, and every row is uniquely identifiable.
What is second normal form?
1NF, plus no partial dependencies: no non-key attribute depends on only part of a composite primary key. It can only be violated when the key is composite, so a single-column key means 2NF is automatic.
Why they ask: The 'only matters with composite keys' point is the part most people miss.
What is third normal form?
2NF, plus no transitive dependencies: no non-key attribute determines another non-key attribute. If employee โ†’ department and department โ†’ department_head, then department_head belongs in a separate departments table.
What is BCNF and how is it stricter than 3NF?
Boyce-Codd normal form requires that for every non-trivial dependency X โ†’ Y, X is a candidate key. 3NF allows an exception where Y is part of some candidate key, so a table can satisfy 3NF and still violate BCNF โ€” usually with overlapping composite candidate keys.
Is BCNF always achievable?
No โ€” and this is the nuance worth knowing. A decomposition into BCNF is always lossless, but it is not always dependency-preserving. Some schemas force a choice between BCNF and keeping every functional dependency enforceable within a single table.
Why they ask: Almost nobody volunteers this, and it's the difference between reciting the forms and understanding them.
What makes a decomposition lossless?
Joining the resulting tables reproduces exactly the original rows โ€” nothing invented, nothing lost. It's guaranteed when the shared attributes of the two tables form a superkey of at least one of them.
What does fourth normal form address?
Multivalued dependencies: one key independently determining two unrelated multivalued facts, such as a person's skills and their languages. Storing both in one table forces a meaningless cross product, so they belong in separate tables.
When would you deliberately denormalize?
When reads dominate and joins are the bottleneck โ€” analytics tables, caches, and precomputed aggregates. You accept redundancy and the write-time cost of keeping copies consistent in exchange for fewer joins.
Name the three anomalies normalization prevents.
Update โ€” changing a fact requires touching many rows. Insert โ€” you can't record one fact without inventing another, like being unable to add a department with no employees. Delete โ€” removing the last row destroys unrelated information.
In practice, how far do people normalize?
Usually 3NF or BCNF. Beyond that the decompositions rarely pay for the extra joins in an operational system, so 4NF and 5NF tend to be exam material rather than daily practice.

You'll forget most of this by next week

That's not a discipline problem, it's how memory works. In the app these come back on an expanding schedule โ€” right before you'd lose them.

Start free for 7 days