Normalisation Tutorial Solutions
Normalisation Tutorial Solutions
Question 1
Where:
Project_id is the identifier of the project,
Emp_name is the name of an employee who works on the project, and
Emp_salary is the salary of the employee whose name is Emp_name.
Assuming that all of the functional dependencies and constraints are apparent in this
data, answer these questions:
b. Are all non-key attributes (if any) fully dependent on the primary key?
Ans: No, non-key attribute Emp_salary is only dependent on Emp_name, not on
the primary key.
c. Is Project_id a determinant?
Ans: No
d. Is Emp_name a determinant?
Ans: Yes, Emp_name determines Emp_salary
f. Is Emp_salary a determinant?
Ans: No
Exercise 1
Exercise 2
Exercise 3
b. From this set of dependencies, state whether this relation is in 3NF, and if not
suggest a decomposition of the relation which then conforms to 3NF.
This relation is not in 3NF because of the FD ProductTypeCode ->
ProductTypeDescription, so we need to decompose into two relations, one
containing (ProductNo, ProductName, ProductTypeCode) and one
containing (ProductTypeCode, ProductTypeDescription)
Question 3
Consider the data that has to be stored in a typical University or College with regard
to Students, Courses, Modules, Lecturers, etc.
Essentially, a student is enrolled onto a programme and may take several modules as
part of this programme. Normalise this data to be in 3NF.
Once we ensure this table is in 1NF, then we can identify the composite primary
key as {StudentNo, ModuleNo}. These together are unique for each tuple in the
relation.
Our relation is therefore clearly not in 2NF, because all the non-key attributes
are not fully dependent on the primary key. Our 2NF solution is therefore to
create three tables:
1. StudentNo*, ModuleNo*
2. StudentNo, Name, Programme, Duration
3. ModuleNo, ModuleName, Lecturer
We then need to consider 3NF. Both tables 1 and 3 are in 3NF, but table 2 is not
because of the transitive dependency. Our solution is therefore to decompose
this into two tables: