Normalization
In this tutorial you’ll learn:
- How to obtain a non-redundant set of functional dependencies.
- How to determine the candidate keys of a table given its functional dependencies.
- How to determine the normal form of a table.
1 Question 1
We consider a relational table \(R\) with four columns \(A\), \(B\), \(C\) and \(D\). Let \(\mathcal{F}\) be the following set of functional dependencies:
\(AB \rightarrow C\)
\(D \rightarrow BC\)
\(A \rightarrow B\)
Exercise
Exercise 1.1 Derive a minimal set \(\mathcal{G}\) of functional dependencies that is equivalent to \(\mathcal{F}\).
2 Question 2
Let \(R\) be a relational table with five columns \((A, B, C, D, E)\). The following set \(\mathcal{F}\) of functional dependencies hold:
- \(AB \rightarrow C\)
- \(C \rightarrow A\)
- \(C \rightarrow B\)
- \(C \rightarrow D\)
- \(D \rightarrow E\)
Exercise
Exercise 2.1 Specify the candidate keys of the table \(R\).
Exercise
Exercise 2.2 We assume that \(R\) is in 1NF.
Is table \(R\) in 2NF? Justify your answer.
Is table \(R\) in 3NF? Justify your answer.
- Is table \(R\) in BCNF? Justify your answer.
Exercise
Exercise 2.3 If the table \(R\) from the previous exercise is not in BCNF, how would you change the schema so that BCNF is satisfied? For each table, specify the primary key and the foreign keys linking the tables to each other.
3 Question 3
Let \(R\) be a relational table with four columns \((A, B, C, D)\). \(\{A, B\}\) is the only candidate key.
Exercise
Exercise 3.1 Identify a minimal set of functional dependencies. Justify your answer.
Exercise
Exercise 3.2 Add \(B \rightarrow D\) to the set of functional dependencies that you identified in the previous exercise. Modify the minimal set of functional dependencies accordingly. Justify your answer.
Exercise
Exercise 3.3 We assume that \(R\) is in 1NF.
Is table \(R\) in 2NF? Justify your answer.
Is table \(R\) in 3NF? Justify your answer.
- Is table \(R\) in BCNF? Justify your answer.
Exercise
Exercise 3.4 Normalize \(R\) to the BCNF form. Justify your choices.
4 Question 4
We consider the following table:
Patient (ssn, first_name, last_name, phone_number, insurance_number,
insurance_expiration_date)
where the following set \(\mathcal{F}\) of functional dependencies holds:
ssn -> first_name, last_name, phone_number, insurance_number,
insurance_expiration_date
insurance_number -> insurance_expiration_date
Exercise
Exercise
Exercise
Exercise