Normalisation Example-Student
Normalisation Example-Student
EXAMPLE::1
Student Example
The following table depicts the set of attribute found in a University database:
Notes: A student attends one course and can take any units during the course. A unit may
be presented as part of any course and is always given by one particular lecturer.
You are required to show the first, second and third normal forms. Explain the
normalisation process used.
Answer
First Normal Form
5. The primary key for the repeating group is unit-code. This is because for each
student_no the unit-code uniquely identifies the unit-name and lecturer attributes.
For example, for student 001, unit U45 is always 'Databases II' and the lecturer is
always 'Brown'.
6. The new relation is:
7. The attribute unit-code is not unique in this relation and so the key of this relation
is (student-no, unit-code).
The student1 relation does not have a composite primary key and, therefore, cannot
contain partial dependencies. The takes1 relation has the following dependencies:
student-no, unit-code -> unit-name, lecturer The primary key determines all attributes.
unit-code ->unit-name Each unit has a name.
unit-code -> lecturer Each unit is taught by the same lecturer.
Therefore, a partial dependency exists between unit-code and unit-name and lecturer.
Removing the partial dependencies from takes1 (but not changing the key of takes1)
produces the relations:
takes2(student-no, unit-code)
takes2(student-no, unit-code)
Removing this transitive dependency from student2 produces the following relations:
course3(course-code, course-length)
unit-code -> unit-name, lecturer The primary key determines all attributes.
Therefore, there are no transitive dependencies in unit2. The set of third normal form
relations are:
course3(course-code, course-length)
takes3(student-no, unit-code)