A3.2.5 · Database design
The difference between normal forms
If fixing one instructor's typo means editing the same name in five different rows, the table is breaking a specific, nameable rule, and normal forms are how you name which one.
Explainer
A workshop signup sheet lists every participant alongside the workshop they joined, its title, and the instructor teaching it, all crammed into one table. Rename the instructor, and that new name has to be typed into every single row they appear in. Miss one, and the table now silently disagrees with itself about who's teaching what. Normalization is the fix, and it comes in graded stages, each one closing off a specific way this kind of table can go wrong.
Normalization is the discipline of restructuring a table's fields so every fact lives in exactly one place, rather than copied wherever it happens to be needed. Fewer duplicate copies also means a physically smaller table, and a smaller table simply has less for the disk to read on every query, so this pays off in raw speed too, not just tidiness.
What normalization is actually fixing
Real problems in an unnormalized table
- Data duplication: the same fact (an instructor's name, a workshop's title) stored in many rows instead of one.
- Missing data: a fact can't be recorded at all until it happens to appear alongside something else, e.g. a new workshop with no participants yet has nowhere to live.
- Dependency concerns: a field that looks like it belongs to the row actually depends on something narrower than the whole key, or on a different field entirely. Several distinct flavours of this exist, covered below.
The vocabulary normal forms are built from
Try to split a field's content into two meaningful pieces, name and surname out of a full name, say, and if that split is possible, the field was never atomic to begin with: atomic means one cell, one fact, nothing hiding inside it that could be pulled apart further. Unique identification is the simpler of the two: some field, or some combination of fields, has to pin down one row and one row only, with zero ambiguity about which row is meant.
Whenever knowing one field's value pins down another field's value automatically, that second field is said to have a functional dependency on the first, the first is its determinant, the second is its dependent. The relationship only runs one way: the determinant fixes the dependent, but the dependent tells you nothing about the determinant. Three specific kinds matter here:
Three kinds of dependency
- Full functional dependency: the dependent attribute relies on the WHOLE primary key. Healthy, this is what every non-key attribute should have.
- Partial dependency: the primary key is composite, made of two or more fields together, and a non-key attribute leans on only one piece of that combination rather than needing the whole thing.
- Transitive dependency: a non-key attribute's real determinant is a DIFFERENT non-key attribute sitting in the same table, not the primary key at all, the primary key only reaches it secondhand.
1NF, 2NF, 3NF: what each one requires, and what it fixes
A working primary key exists, no attribute is repeated, no group of attributes recurs, and every field genuinely holds one indivisible value.
Fixes: combined, non-atomic fields and repeating groups.
Example: see Step 2 of the stepper below.
Everything 1NF already requires, PLUS every non-key field genuinely needs the complete primary key to determine it, not just a slice of it, so no partial dependency survives.
Fixes: partial-key dependencies (only relevant when the key is composite).
Example: see Step 3 of the stepper below.
Everything 2NF already requires, PLUS tracing any non-key field back to its determinant leads straight to the primary key, with no detour through some other non-key field along the way.
Fixes: transitive (non-key) dependencies.
Example: see Step 4 of the stepper below.
Worked example
One unnormalized table, several real violations
WORKSHOP_SIGNUP tracks who's attending which workshop. Click any column to see exactly which rule it breaks, and why.
| P01 | Noor Aziz | W1 | Digital Photography | I1 | Marcus Webb |
| P02 | Tariq Idris | W1 | Digital Photography | I1 | Marcus Webb |
| P01 | Noor Aziz | W2 | Pottery Basics | I2 | Sana Farouk |
Click a column header to see the rule it breaks (or satisfies).
Click a column above to see its dependency status.
Now watch it actually get fixed, one normal form at a time
Same table, same violations, click through and see exactly what each normal form changes.
Check your understanding
InstructorName depends on InstructorID, which is itself just a non-key attribute in the table, not part of the primary key. What kind of dependency is this?
Common mistake
A3.2.5RecurringPartial dependency and transitive dependency get confused constantly, since both are "a non-key attribute depending on the wrong thing." The difference is WHAT the wrong thing is: partial dependency is about depending on only part of a composite primary key, transitive dependency is about depending on another non-key attribute instead of the primary key at all.
What a weak answer looks like: "InstructorName is a partial dependency because it doesn't depend on the whole key." Half right, it doesn't depend on the key, but not because of a composite-key split, InstructorName depends on a DIFFERENT non-key field entirely.
What it should say: "InstructorName is a transitive dependency, it depends on InstructorID, a non-key attribute, rather than depending directly on the primary key." Names the correct dependency type by identifying exactly what it depends on.
Revision questions
Past-paper style. Write an answer, then reveal the marking points and mark yourself.
[2]Explain what is meant by atomicity, and give an example of a field that is not atomic.
Marking points
评分要点
- Atomicity means every field holds a single indivisible value that cannot be meaningfully split further.
- Example of a non-atomic field: one PhoneNumbers field holding 020-111, 020-222 (or a Name field holding first and last together).
- 原子性指每个字段持有一个不可再分、无法进一步有意义拆分的单一值。
- 非原子字段的例子:一个 PhoneNumbers 字段同时存 020-111、020-222(或一个 Name 字段把名和姓存在一起)。
[3]Explain the difference between a partial dependency and a transitive dependency.
Marking points
评分要点
- A partial dependency is when a non-key field depends on only part of a composite primary key.
- A transitive dependency is when a non-key field depends on another non-key field rather than on the key.
- Removing partial dependencies gives 2NF; removing transitive dependencies gives 3NF.
- 部分依赖是指一个非键字段只依赖于复合主键的一部分。
- 传递依赖是指一个非键字段依赖于另一个非键字段,而不是依赖于键。
- 去除部分依赖得到 2NF;去除传递依赖得到 3NF。
[4]A table ORDER_ITEM(OrderID, ProductID, ProductName, Quantity) uses a composite primary key of OrderID and ProductID. ProductName depends only on ProductID. Identify the type of dependency this creates, and explain which normal form it violates.
Marking points
评分要点
- ProductName depends on ProductID, which is only part of the composite key (OrderID, ProductID): this is a partial dependency.
- A partial dependency violates second normal form (2NF).
- The fix is to move ProductID and ProductName into a separate PRODUCT table.
- ProductName 依赖于 ProductID,而 ProductID 只是复合键 (OrderID, ProductID) 的一部分:这是部分依赖。
- 部分依赖违反第二范式(2NF)。
- 修正方法是把 ProductID 和 ProductName 移到单独的 PRODUCT 表。
Flashcards
Active recall for this statement's key terms.
Keep this statement's practice with you
Free account: unlock every revision question and flashcard for A3.2.5, and every other IB CS 2027 statement.