Professional Documents
Culture Documents
EXAMPLE::1
Student Example
The following table depicts the set of attribute found in a University database:
Student-No Student-Name Course-Code Course-Length 001 00! Smith Soap A 0! A10" ! "
Lecturer
&atabases '' )rown (rogramming *reen Algorithms (urple &atabases '' )rown )usiness ' ,ed )usiness '' &atabases ' )usiness '' Algorithms (in. /range (in. (urple
00% 010
-ho 0emon
A 0! A! !
Notes: A student attends one course and can ta.e any units during the course1 A unit may be presented as part of any course and is always given by one particular lecturer1 2ou are re3uired to show the first4 second and third normal forms1 56plain the normalisation process used1
Ans er
!irst Normal !orm
7,emove repeating groups7 11 The attribute chosen as the primary .ey is student-no1 1 The set of attributes which repeat for each value of student-no are unit-code4 unitname4 and lecturer1 !1 ,emoving these attributes from the full attribute set produces the relation: (student8no4 student8name4 course8code4 course8length) "1 The primary .ey is student-no1 (student8no4 student8name4 course8code4 course8length) #1 The primary .ey for the repeating group is unit-code1 This is because for each student_no the unit-code uni3uely identifies the unit-name and lecturer attributes1
9or e6ample4 for student 0014 unit U"# is always :&atabases '': and the lecturer is always :)rown:1 +1 The new relation is: (student8no4 unit8code4 unit8name4 lecturer) %1 The attribute unit-code is not uni3ue in this relation and so the .ey of this relation is (student8no4 unit8code)1 (student8no4 unit8code4 unit8name4 lecturer) $1 There are no more repeating groups1 The first normal form relations are: student1(student8no4 student8name4 course8code4 course8length) ta.es1(student8no4 unit8code4 unit8name4 lecturer)
Therefore4 the following transitive dependency e6ists: student8no 8; course8code 8; course8length ,emoving this transitive dependency from student2 produces the following relations: student!(student8no4 student8name4 course8code) course!(course8code4 course8length) The takes2 relation contains no non8.ey attributes and so contains no transitive dependencies1 The unit2 relation contains the following dependencies: unit8code 8; unit8name4 lecturer The primary .ey determines all attributes1 Therefore4 there are no transitive dependencies in unit21 The set of third normal form relations are: student!(student8no4 student8name4 course8code) course!(course8code4 course8length) ta.es!(student8no4 unit8code) unit!(unit8code4 unit8name4 lecturer)