Instiq
Chapter 2 · Database design & normalization·v1.0.0·Updated 7/10/2026·~17 min

What's changed: Initial version

2.2Functional dependency and normalization theory

Key points

Covers functional dependency, which expresses a dependency between attributes; partial functional dependency, where an attribute depends on only part of a composite key; transitive functional dependency, where an attribute depends indirectly via a non-key attribute; and first, second, and third normal form, which progressively eliminate these dependencies to prevent update anomalies—framed as the practical design judgment of removing update anomalies.

Normalization is not "theory for theory's sake"—it is a practical procedure for removing update anomalies lurking in a schema (problems where the same fact ends up written in multiple places, leading to missed updates, contradictions, and unnecessary NULLs). A database designer must recognize what update anomalies a given schema is prone to and judge the degree of normalization needed—no more, no less—to eliminate them. This section covers the concept of functional dependency, the foundation of normalization, and which anomaly each of first, second, and third normal form removes.

2.2.1Functional dependency fundamentals

  • A functional dependency (X → Y) is a relationship in which, once the value of an attribute (or set of attributes) X is fixed, the value of attribute Y is uniquely determined. For example, "employee ID → name" holds because fixing the employee ID uniquely determines the name.
  • Full functional dependency is where Y depends functionally on the entirety of a composite key X and on no proper subset of X. Partial functional dependency is where Y depends on only part of a composite key X (for example, given the composite key (employee ID, project ID), an employee's name is actually determined by employee ID alone).
  • A transitive functional dependency exists when X → Y and Y → Z both hold, so X → Z follows as a consequence, but Z depends on X only indirectly, via the non-key attribute Y (for example, the chain employee ID → department code → department name means department name is only indirectly determined by employee ID).

2.2.2First and second normal form

  • First normal form (1NF) eliminates repeating groups—cramming multiple values into a single column (cell)—so that every attribute holds only a single (atomic) value. Leaving repeating groups in place results in an inefficient design where searching or updating on a specific value requires parsing the entire column's string.
  • Second normal form (2NF) satisfies 1NF and additionally eliminates partial functional dependency (every non-key attribute is fully functionally dependent on the entire composite key). If a partial functional dependency remains, a fact tied to only part of the composite key ends up duplicated and managed alongside the other part, causing update anomalies (the same fact stored redundantly, with the risk of missed updates).

2.2.3Third normal form and removing transitive dependencies

  • Third normal form (3NF) satisfies 2NF and additionally eliminates transitive functional dependency (no non-key attribute depends on the key only indirectly, via another non-key attribute). If a transitive dependency remains, information that is redundantly stored (such as a department name) can become inconsistent unless the intervening non-key attribute (such as a department code) is kept in perfect sync everywhere it appears.
  • The more normalization is pursued, the fewer update anomalies remain, but the number of tables increases, so SQL requires more JOINs, and read performance degrades. Given this trade-off, practical design requires judging that business data with frequent updates, where consistency matters most, should be prioritized for normalization, while read-mostly data with almost no updates is a candidate for denormalization (covered later, in section 5).
Exam point

Most-tested: "1NF = eliminating repeating groups", "2NF = eliminating partial functional dependency (full functional dependency on the entire composite key)", and "3NF = eliminating transitive functional dependency (cutting indirect dependency via a non-key attribute)". "Partial" and "transitive" functional dependency are easily confused, so always distinguish the axis: partial = depends on only part of a composite key; transitive = indirect dependency via a non-key attribute.

A designer of a project-management system is asked to review a schema currently run as a single table: a "project assignment" table (employee ID, project ID, employee name, department code, department name, assignment role), with the composite key (employee ID, project ID) as its primary key. Looking first at "employee name": it is determined by employee ID alone, not by project ID—a partial functional dependency. In this state, if one employee is assigned to three projects, the same name is duplicated across three rows, and changing that name requires updating all three rows or a contradiction (an update anomaly) results. Looking next at "department name": it is determined via the chain employee ID → department code → department name, so a transitive functional dependency from employee ID to department name exists. If a department's name changes, every assignment row for every employee in that department must be updated without omission, or a contradiction results—another update anomaly. To resolve both, the design first applies 2NF, splitting off an "employee" table (employee ID, employee name, department code), extracting the partially dependent name so it depends on employee ID alone. It then applies 3NF, further splitting off a "department" table (department code, department name), extracting department name so it depends on department code alone. The "project assignment" table is left holding only (employee ID, project ID, assignment role); update anomalies are resolved, but obtaining an employee's name or department name now requires joining multiple tables. Here the designer concludes that, since project assignments change frequently and employee transfers happen routinely, prioritizing consistency by proceeding with normalization is the correct judgment, treating the resulting increase in JOIN cost as a separate problem to be addressed later through performance design (such as indexing).

Normal formWhat it eliminatesUpdate anomaly it prevents
First normal form (1NF)Repeating groupsInefficient search/update on individual values
Second normal form (2NF)Partial functional dependencyDuplication and missed updates for attributes depending on only part of a composite key
Third normal form (3NF)Transitive functional dependencyDuplication and missed updates from indirect dependency via a non-key attribute
Warning

Trap: "Partial functional dependency and transitive functional dependency are the same problem" is wrong—partial functional dependency is a problem of depending on only part of a composite key (resolved by 2NF), while transitive functional dependency is a problem of depending indirectly via a non-key attribute (resolved by 3NF); these are separate layers of the problem. Also wrong: "normalization should always be pushed to the highest possible degree"—given the trade-off against performance degradation from increased JOIN cost, the judgment must stop at whatever degree is necessary and sufficient for the update frequency and consistency requirements.

FDs and 1NF-3NF.
Decomposing away anomalies

2.2.4Section summary

  • Functional dependency (X to Y) is the foundation of normalization. Partial functional dependency depends on only part of a composite key; transitive functional dependency depends indirectly via a non-key attribute
  • 1NF eliminates repeating groups, 2NF eliminates partial functional dependency, and 3NF eliminates transitive functional dependency, progressively removing update anomalies
  • Normalization trades off against increased JOIN cost; judging when to stop at the degree that is necessary and sufficient for the update frequency and consistency requirements matters in practice

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. A "project assignment" table (employee ID, project ID, employee name, assignment role) has the composite key (employee ID, project ID). Employee name is determined by employee ID alone and does not depend on project ID. Which update anomaly is this table most likely to suffer from?

Q2. Further investigation of the table from the previous question reveals that department name is determined via the chain "employee ID to department code to department name," meaning a transitive functional dependency exists from employee ID to department name. What is the appropriate action to eliminate this transitive functional dependency?

Q3. A data-platform engineer argues that even a read-only aggregate reporting table, which is almost never updated, should still be strictly normalized to third normal form. Which is the most appropriate evaluation of this argument?

Check your understandingPractice questions for Chapter 2: Database design & normalization