Normalisation Workbook Answers
Normalisation Workbook Answers
• Each data item cannot be broken down any further i.e. it is ‘atomic’
• Each row/record is unique and has a primary key
• There are no records with repeating data
• Each field should be unique
Atomic data
Rule 1: Each data item cannot be broken down any further i.e. it is ‘atomic’
Teacher Atomic
Keyboard Atomic
Address: 9 Oak Crescent, Snitterfield, Street & house no: 9 Oak Crescent
CV11 9NB Town: Snitterfield
Postcode: CV11 9NB
The records below have no primary key. Choose a suitable primary key and
complete the table.
The records below have no primary key. Choose a suitable primary key and
complete the table.
Table 1:
ID* Title Surname Telephone no
001 Miss Smith 01234 567890
002 Miss White 01234 890123
003 Miss James 01234 798453
004 Miss Green 01234 578345
Reason: There is no repeating data (Miss in title field is not repeating in each
record)
Table 2:
ID* Title Surname Full Name Telephone no
001 Mrs Field Mrs Field 01234 523645
002 Miss White Miss White 01234 890123
003 Mr Hancock Mr Hancock 01234 989654
004 Miss Green Miss Green 01234 578345
Reason: Full name is repeated data from the title and surname fields.
Table 3:
ID* Title Surname Email
001 Mrs Field [email protected]
Table 1:
Reason: Not all of the field names in the record are unique, telephone
repeats three times.
Table 2:
Reason: Not all of the field names in the record are unique, module repeats
two times.
Remembering all of the rules of First Normal Form, identify which of the
following tables are in 1NF. Explain your reason
Example 1:
Example 2:
Reason: A primary key is defined. The data is atomic. Each field has a
unique name. There is no repeating data.
Example 3:
Reason: It has a primary key. Data is atomic. There are fields with the
same name. Data is repeated (colour)
Example 4:
Example 6:
Reason: A primary key is defined. The data is atomic. Each field has a
unique name. There is no repeating data.
Entity – Band
Entity – Fan
Each band has many fans. Each person is a fan of only one band.
Taking this information into account, draw the correct ER diagram below:
BAND FAN
The The
attributes of attributes of
the band the fans
might be: might be:
Answer:
This table is not in 1NF because Jane has two email addresses loaded into the
email field. The data is not atomic.
Loading the data in this way is going to make it very difficult to extract email
addresses.
Also, the data length of the email field now has to be long enough to handle
many email addresses – this is inefficient.
Answer:
This table is also not in 1NF because there are repeating fields.
The second email in Tom’s record is not being used and so is causing wasted
storage.
Also, what if a fan has a lot of emails – how many fields would you set up?
The database designer finally comes up with the correct solution. He needs
to create a third table called EMAIL and use a foreign key in the fan table to
link to the primary key in the EMAIL table.
BA FA
EM
Complete the three tables for this database below and add one record for
each. Indicate the primary keys by using a *
BAND
BandID* BandName MusicType
005 Girls Aloud Pop
FAN
FanID* FirstName Surname BandID EmailID
001 Tom Smith 23 012
EMAIL
EmailID* FanID Email
012 001 [email protected]
No
No
If it is not in 2NF, identify which non-key attribute does not depend on one of
the key attributes.
Answer:
The non-key attribute ‘style’ isn’t dependent on all of the key attributes, it has
nothing to do with the venue or the date.
CONCERT:
Venue* ArtistID* Date* Attendance Profit
Wembley 002 14/05/09 23000 12334
ARTIST:
ARTISTID* Artist StyleID
002 Girls Aloud 014
STYLE:
STYLEID* Style
014 Girl Band
PROJECT:
EmployeeID* ProjectID* DateHired ProjectManager
EmployeeID, ProjectID
DateHired, ProjectManager
Does every non-key attribute depend on every key attribute? Explain your
answer
No.
PROJECT:
ProjectID* EmployeeID ProjectManagerID
EMPLOYEE:
EmployeeID* Date Hired
PROJECTMANAGER:
ProjectManagerID* ProjectManagerName
COURSES:
CourseID* Term* PlacesAvailable CourseTitle
001 Autumn 50 Computing
001 Spring 40 Computing
001 Summer 45 Computing
002 Autumn 100 ICT
002 Spring 90 ICT
003 Summer 100 Robotics
CourseID, Term
PlacesAvailable, CourseTitle
Does every non-key attribute depend on every key attribute? Explain your
answer
No.
Course title is dependent on CourseID, but it has nothing to do with Term
COURSES AVAILABLE:
CourseID* Term* PlacesAvailable
COURSE:
CourseID* CourseTitle
The table is in 2NF but it is not in 3NF because ‘Country’ could be derived
from ‘City’
City* Country
London UK
Birmingham UK
The new table called ‘countries’ has City as the primary key and ‘country’ as
an attribute.
The concert table has ‘city’ as a foreign key. Now there is no redundant data.
3NF – an example
No
COURSES AVAILABLE
CourseID* Term* PlacesAvailable TeacherID
TEACHER
TeacherID Teacher