Problems - Normalization
Problems
Given:Relation:
R(A, B, C, D, E)
Functional Dependencies:
- A → B
- A → C
- BC → D
- D → E
i. Identify the candidate key(s).
ii.Determine whether R is in 1NF, 2NF, and 3NF. Give reasons for each.
iii. If R is not in 3NF, decompose it into 3NF relations.
(i) Find Candidate Key(s)
Step 1: Find closure of A
Compute :
- A → B, C ⇒ {A, B, C}
- BC → D ⇒ {A, B, C, D}
- D → E ⇒ {A, B, C, D, E}
👉
✅ Conclusion:
- A determines all attributes
- So, A is a candidate key
Check others (brief):
- No smaller subset exists
- So only one candidate key
✅ Answer:
Candidate Key = {A}
(ii) Normal Forms
✅ 1NF (First Normal Form)
- Assumes atomic attributes (given in question)
✔ R is in 1NF
✅ 2NF (Second Normal Form)
Rule:
- No partial dependency on candidate key
👉 Candidate key = A (single attribute)
- Partial dependency happens only with composite keys
- Here key is single → no partial dependency possible
✔ R is in 2NF
❌ 3NF (Third Normal Form)
Rule:
For every FD , either:
- X is a super key, OR
- Y is a prime attribute
Check each FD:
| FD | Status |
|---|---|
| A → B | OK (A is key) |
| A → C | OK (A is key) |
| BC → D | ❌ BC is not key |
| D → E | ❌ D is not key |
❌ Violations:
- BC → D
- D → E
👉 Non-key attributes determining other attributes
❌ Conclusion:
R is NOT in 3NF
(iii) Decomposition into 3NF
We decompose based on violating FDs.
Step 1: Create relations for each FD
From A → B, C:
From BC → D:
From D → E:
Step 2: Ensure key is preserved
- A is present in R1 → OK
✅ Final 3NF Relations:
Comments
Post a Comment