Functional Dependency and Normalization
This page first looks at functional dependency, the basis of normalization, then continues with the normalization steps that remove these dependencies one by one (1NF → BCNF), a memorization trick, and 6 practice problems I solved myself.
Functional Dependency: If You Know X, You Know Y
A functional dependency is the relationship "if you know the value of attribute X, the value of attribute Y is automatically fixed to one value." It is written X → Y, and X is called the determinant and Y the dependent.
Watch out: the arrow holds in one direction only. Just because X → Y holds doesn't mean Y → X holds too. (Like how knowing a student ID tells you the name, but a name alone doesn't tell you the student ID.)
To understand normalization, you need to be able to tell three kinds of dependency apart. Take a grades table whose primary key is made of two columns, [StudentID, CourseCode], as an example.
| StudentID | CourseCode | StudentName | Grade | Dept | DeptOffice |
|---|---|---|---|---|---|
| 100 | C1 | Chulsoo | A | CS | Bldg 3, Rm 401 |
| 100 | C2 | Chulsoo | B | CS | Bldg 3, Rm 401 |
- Full functional dependency: depends on the entire primary key.
[StudentID, CourseCode] → Gradeis a full functional dependency because the grade is determined only when both the student ID and the course code are known. - Partial functional dependency: depends on only part of the primary key.
StudentID → StudentNameis a partial functional dependency because it is determined by the student ID alone, without the course code. - Transitive functional dependency: if
X → YandY → Z, thenX → Zresults. SinceStudentID → DeptandDept → DeptOffice,StudentID → DeptOfficealso holds. The student ID determines the department office "indirectly."
The process of removing these three kinds of dependency one by one is exactly the normalization that comes next.
Normalization: The Technique of Not Keeping Duplicate Data
In a word, normalization is "splitting tables so the same information isn't stored redundantly in several places." With duplication, updating only one copy leaves the others with stale values (anomalies), and normalization prevents this. Each higher step adds one more rule.
First Normal Form (1NF): One Value per Cell
Every attribute value must be an atomic value. If one student's "hobbies" cell contains "soccer, reading" together, it must be split into rows.
Second Normal Form (2NF): Remove Partial Functional Dependencies
Satisfy 1NF, and move attributes that depend on only part of the primary key into a separate table. For example, in a table whose primary key is [StudentID, CourseCode], [StudentName], which depends only on [StudentID], is split into a separate "Student" table. (If the primary key has only 1 attribute to begin with, this problem is solved automatically.)
Third Normal Form (3NF): Remove Transitive Functional Dependencies
Satisfy 2NF, and also split out non-key attributes that are tangled with each other as cause and effect. With a StudentID → Dept → DeptOffice relationship, move [Dept, DeptOffice] into a separate table.
BCNF: Every Determinant Must Be a Candidate Key
Even after satisfying 3NF, an exceptional problem can remain. In a table with the composite primary key [StudentID, CourseName], suppose each course is taught by only one [Professor] and that professor teaches only that course; then Professor → CourseName holds. But [Professor] is not a candidate key (it can't distinguish student IDs). Having a determinant that isn't a candidate key like this violates BCNF, and the fix is to split again into two tables: [StudentID, Professor] and [Professor, CourseName].
Degree of normalization ─────────────────▶
1NF → 2NF → 3NF → BCNF
(atomic) (no partial) (no transitive) (determinant = candidate key)The more you normalize, the less duplication you have, but there is a trade-off: the number of tables you need to join when querying goes up.
Memorize It in One Go: 도부이결다조 (Do-Bu-I-Gyeol-Da-Jo)
After BCNF there are also 4NF and 5NF. In practice people usually go only up to 3NF or BCNF, but the step names are easy to remember with the Korean mnemonic "도부이결다조", built from the first syllable of each Korean term.
| Step | First syllable | What it removes |
|---|---|---|
| 1NF | 도 (Do) | A domain that is not atomic (several values in one cell) |
| 2NF | 부 (Bu) | Partial functional dependency |
| 3NF | 이 (I) | Transitive functional dependency |
| BCNF | 결 (Gyeol) | A determinant that is not a candidate key |
| 4NF | 다 (Da) | Multivalued dependency |
| 5NF | 조 (Jo) | Join dependency |
Practice Problems
These are problems I solved myself. Dependency problems get much easier if you start by checking what the table's primary key (PK) is. Also keep in mind that from the data in the table alone, you can say a dependency is "wrong," but you can't be sure it is "always right." A counterexample may be in data that hasn't come in yet.
Problem 1. How Do You Satisfy 1NF?
The [Member] table is in its pre-normalization state. What must be done to satisfy 1NF?
| MemberID (PK) | MemberName | Contact | Hobbies |
|---|---|---|---|
| M001 | Kim Chul-soo | 010-1111-2222 | Soccer, hiking, reading |
| M002 | Lee Young-hee | 010-3333-4444 | Cooking, watching movies |
- Delete the 'Hobbies' attribute.
- Change the data type of the 'Hobbies' attribute to a variable-length string (VARCHAR).
- Split the multiple 'Hobbies' values in one cell so that each cell holds only one value, breaking them into separate rows.
- Designate 'MemberID' and 'Hobbies' together as the primary identifier (PK).
Answer and explanation
Answer: 3
The condition of 1NF is "every attribute value is a single atomic value." Kim Chul-soo's hobbies cell holds three values, so they must be split into individual rows or a separate table so that each cell holds only one.
Problem 2. Splitting into 2NF
The [Enrollment] table satisfies 1NF. The primary identifier is the composite key [StudentID + CourseCode], and the dependencies are as follows.
[StudentID + CourseCode] → [Grade](full functional dependency)[CourseCode] → [CourseName], [Classroom](partial functional dependency)
| StudentID (PK) | CourseCode (PK) | Grade | CourseName | Classroom |
|---|---|---|---|---|
| 202601 | CS01 | A | Database | Room 301 |
| 202601 | CS02 | B | Algorithms | Room 402 |
| 202602 | CS01 | A+ | Database | Room 301 |
Which one splits it correctly into 2NF?
- Leave it as
[StudentID, CourseCode, Grade, CourseName, Classroom]. - Split into
[StudentID, CourseCode, Grade]and[CourseCode, CourseName, Classroom]. - Split into
[StudentID, CourseName]and[CourseCode, Grade, Classroom]. - Split into
[StudentID, Grade]and[CourseCode, CourseName, Classroom].
Answer and explanation
Answer: 2
2NF is the step that removes partial functional dependencies. CourseName and Classroom depend only on CourseCode, which is part of the primary key rather than the whole, so this group is moved into its own [CourseCode, CourseName, Classroom] table, and only [StudentID, CourseCode, Grade] remains in the original table. Option 4 is wrong because you can no longer tell which course a grade belongs to.
Problem 3. Finding a Transitive Functional Dependency
The [Employee] table satisfies 2NF, and its primary identifier is [EmployeeNo]. Knowing the employee number tells you the department code, and knowing the department code tells you the department location (floor).
| EmployeeNo (PK) | EmployeeName | DeptCode | DeptLocation |
|---|---|---|---|
| E001 | Park Min-su | DEPT_IT | 5th floor |
| E002 | Choi Hyun-woo | DEPT_HR | 3rd floor |
| E003 | Yoon Ji-a | DEPT_IT | 5th floor |
What is the transitive functional dependency (X → Y → Z) in this table?
- EmployeeNo → EmployeeName → DeptCode
- EmployeeNo → DeptCode → DeptLocation
- DeptLocation → DeptCode → EmployeeNo
- DeptCode → EmployeeNo → DeptLocation
Answer and explanation
Answer: 2
The primary key EmployeeNo (X) determines the general attribute DeptCode (Y), and DeptCode (Y) determines another general attribute DeptLocation (Z). In the end, the employee number indirectly determines the department location, which is a transitive dependency, so to satisfy 3NF [DeptCode, DeptLocation] must be moved out separately.
Problem 4. Which Functional Dependency Cannot Hold?
This is the [BookRental] table. For the same MemberID, the member name and tier are always the same, and for the same BookCode, the book title is always the same.
| RentalNo (PK) | MemberID | MemberName | Tier | BookCode | BookTitle |
|---|---|---|---|---|---|
| R_01 | M01 | Hong Gil-dong | VIP | B100 | SQL Basics |
| R_02 | M02 | Yi Sun-sin | GOLD | B200 | Mastering Java |
| R_03 | M01 | Hong Gil-dong | VIP | B200 | Mastering Java |
| R_04 | M03 | Gang Gam-chan | GOLD | B300 | Web Design |
- RentalNo → MemberID
- MemberID → MemberName
- BookCode → BookTitle
- BookTitle → MemberID
Answer and explanation
Answer: 4
For X → Y to hold, whenever the X values are the same, the Y value must also be the same single value.
- 1: RentalNo is the primary key, so it determines every attribute. (holds)
- 2: When MemberID is the same (M01), MemberName is Hong Gil-dong in both. (holds)
- 3: When BookCode is the same (B200), BookTitle is Mastering Java in both. (holds)
- 4: BookTitle is the same (Mastering Java), but MemberID differs (M02 and M01). (does not hold)
Problem 5. Full vs Partial Functional Dependency
The [OrderDetail] table has the composite primary key [OrderNo + ProductCode]. The dependencies are [OrderNo, ProductCode] → [Quantity] and [ProductCode] → [ProductName].
| OrderNo (PK) | ProductCode (PK) | Quantity | ProductName |
|---|---|---|---|
| O_001 | P_A | 5 | Monitor |
| O_001 | P_B | 2 | Keyboard |
| O_002 | P_A | 3 | Monitor |
Which of the following is incorrect?
Quantitydepends on the entire primary key, so it is a full functional dependency.ProductNamedepends only onProductCode, part of the composite primary key, so it is a partial functional dependency.- This table has a partial functional dependency, so it violates 2NF.
- To satisfy 2NF, it must be decomposed into an
[OrderNo] → [Quantity]relationship.
Answer and explanation
Answer: 4
- 1: Quantity is determined only when both pieces of information, which order and which product, are known, so it is indeed a full functional dependency.
- 2: ProductName is determined just by knowing ProductCode, regardless of OrderNo, so it is indeed a partial functional dependency.
- 3: Having a partial functional dependency does violate 2NF.
- 4: What needs to be split off is the cause,
ProductCode, and the result,ProductName. They go into a[ProductCode, ProductName]table, and Quantity must stay in[OrderNo, ProductCode, Quantity]as is.
Problem 6. Finding a Transitive Functional Dependency with Symbols
There are attributes A, B, C, D, and the following dependencies have been confirmed.
A → B(A is the primary key)B → CA → C(determined indirectly through B)A → D
Which transitive functional dependency (X → Y → Z) must be removed for 3NF?
- A → B → C
- B → C → D
- A → C → D
- B → A → C
Answer and explanation
Answer: 1
The primary key A determines the general attribute B (A → B), and B determines another general attribute C (B → C), so A → B → C is the transitive dependency. Splitting into an [A, B, D] table and a [B, C] table satisfies 3NF.
Handwritten Notes
Normalization problem-solving notes (images)


Functional dependency problem-solving notes (images)


Summary
| Step | Condition | What it removes |
|---|---|---|
| 1NF | Every attribute value is atomic | Several values in one cell |
| 2NF | 1NF + full functional dependency on the entire primary key | Partial functional dependency |
| 3NF | 2NF + no dependencies between non-key attributes | Transitive functional dependency |
| BCNF | Every determinant is a candidate key | Determinants that aren't candidate keys |
- Functional dependency
X → Y: knowing X (the determinant) fixes Y (the dependent) to one value, and it holds in one direction only. - The more you normalize, the less duplication, but the more tables you need to join when querying.
- Memorize the step names with 도부이결다조 (1NF domain atomic → 2NF partial → 3NF transitive → BCNF determinant → 4NF multivalued → 5NF join).
Reference: personal Notion study notes
