0% found this document useful (0 votes)
155 views14 pages

Y12 Normalisation - Workbook

The document provides information about normalizing data into first and second normal forms. It defines the rules for 1NF and 2NF and provides examples of tables to identify if they are in 1NF or 2NF. It also shows how to redesign tables to satisfy the rules of 1NF and 2NF.

Uploaded by

Syeda Hafiza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
155 views14 pages

Y12 Normalisation - Workbook

The document provides information about normalizing data into first and second normal forms. It defines the rules for 1NF and 2NF and provides examples of tables to identify if they are in 1NF or 2NF. It also shows how to redesign tables to satisfy the rules of 1NF and 2NF.

Uploaded by

Syeda Hafiza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 14

Normalisation Workbook

You can use ICT Lab,do research online or use your handbook to answer all
questions.

You can pair up or do this in groups – but every student need to upload this
booklet on his/her own.

First Normal Form (1NF)

The rules for 1NF:

• 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’

State whether the following examples are atomic or non atomic

Data Atomic or non atomic

Miss Jane Green Non atomic

9 Oak Crescent, Warwick


Teacher
01926 123456
King George IV School London
CV11 9NB
Keyboard
Star Trek 12A
Jaguar XJS

Buckingham Palace

Supersize cheeseburger

© www.teach-ict.com All Rights Reserved


Change the following examples of non atomic data into atomic data

Non Atomic Atomic

Name: Sally Chadwick First name: Sally


Surname: Chadwick

Address: 9 Oak Crescent, Snitterfield,


CV11 9NB
King George IV School London
Star Trek 12A
Jaguar XJS

Rule 2: Each row/record is unique and has a primary key

The records below have no primary key. Choose a suitable primary key and
complete the table.

Title First Name Surname Dob


Mr James Smith 14/05/57
Miss Emma White 21/11/78

The records below have no primary key. Choose a suitable primary key and
complete the table.

FilmTitle Rating Genre


Star Trek 12A Sci Fi
The Little Mermaid U Children

Rule 3: There are no records with repeating data

Look at the tables below and answer the questions:

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

© www.teach-ict.com All Rights Reserved


Is this table in 1NF? Yes No

Reason:

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

Is this table in 1NF? Yes No

Reason

Table 3:
ID* Title Surname Email
001 Mrs Field [email protected]

002 Miss White [email protected]


[email protected]
003 Mr Hancock [email protected]

004 Miss Green [email protected]


[email protected]

Is this table in 1NF? Yes No

Reason:

© www.teach-ict.com All Rights Reserved


Rule 4: Each field name should be unique

Look at the tables below and answer the questions:

Table 1:

ID* Title Surname Telephone no Telephone no Telephone no


001 Mr Smith 01234 567890 01234 789123 01234 345678
002 Miss White 01234 890123 01234 456789 01234 213456

Is this table in 1NF? Yes No

Reason:

Table 2:

ID* FirstName Surname Course Module Module


00123 Tamsin Wall Business Accounts Economics
Studies
00245 Steven Weeks Business Operations Business Law
Studies Management

Is this table in 1NF? Yes No

Reason:

© www.teach-ict.com All Rights Reserved


Identifying tables in First Normal Form (1NF)

Remembering all of the rules of First Normal Form, identify which of the
following tables are in 1NF. Explain your reason

Example 1:

Title FirstName Surname Address City Postcode


Mr Tom Smith 42 Mill Street London SE31 1WE

Is this table in 1NF? Yes No

Reason:

Example 2:

ID* Username Last Activity Result AccountActive


accessed
1003 Smithj08 2009 06 Save file Success Y
21: 14:03

Is this table in 1NF? Yes No

Reason: .

Example 3:

ItemID* Product Description Size Colour Colour Colour


234 Shoe High Heel 6 Red Blue Green

Is this table in 1NF? Yes No

Reason:

Example 4:

StudentID* FirstName Surname SchoolID ClassID


354 Tom James 016 5F

Is this table in 1NF? Yes No

Reason:
Example 5:

© www.teach-ict.com All Rights Reserved


ID* Title FirstName Surname Full Address City Postcode
name
004 Mr Tom Smith Tom 42 Mill London SE31
Smith Street 1WE

Is this table in 1NF? Yes No

Reason:

Example 6:

ID* Film Rating Genre Actor Length


004 Star Trek 12A Sci Fi Leonard 180 mins
Nimoy

Is this table in 1NF? Yes No

Reason:

1NF Worked Example

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:

FAN
BAND

The The
attributes of attributes of
the band the fans
might be: might be:

Write the correct database notation for each table.

© www.teach-ict.com All Rights Reserved


The database designer sets up the FAN table:

FanID* FirstName Surname BandID Email


001 Tom Smith 23 [email protected]
002 Jane Green 43 [email protected]
[email protected]

Identify the problem with this table:

Answer:

The database designer has a second go at setting up the FAN table:

FanID* FirstName Surname BandID Email Email


001 Tom Smith 23 [email protected]
002 Jane Green 43 [email protected] [email protected]

Identify the problem with this new design.

Answer:

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.

Complete the ER diagram below:

BA FA

EM

© www.teach-ict.com All Rights Reserved


Complete the three tables for this database below and add one record for
each. Indicate the primary keys by using a *

BAND
BandID*

FAN
FanID* FirstName

EMAIL
EmailID*

© www.teach-ict.com All Rights Reserved


Second Normal Form (2NF)

The rules for 2NF:

• The table must be in 1NF


• Non-key attributes must depend on every part of the primary key

Venue* Artist* Date* Attendance Profit Style


Wembley Girls Aloud 14/05/09 23000 12334 Girl band
NEC Leona 18/05/09 15000 43025 Female
Lewis soloist

Identify the key attributes in this table:

Identify the non-key attributes in this table:

Does every non-key attribute depend on every key attribute?

If your answer above was no, is this table in 2NF?

If it is not in 2NF, identify which non-key attribute does not depend on one of
the key attributes.

Answer:

© www.teach-ict.com All Rights Reserved


Redesign this database so that it is in 2NF

CONCERT:

ARTIST:

STYLE:

2NF another example

PROJECT:
EmployeeID* ProjectID* DateHired ProjectManager

Identify the key attributes in this table:

Identify the non-key attributes in this table:

Does every non-key attribute depend on every key attribute? Explain your
answer

Redesign this database so that it is in 2NF

PROJECT:

© www.teach-ict.com All Rights Reserved


EMPLOYEE:

PROJECTMANAGER:

2NF another example

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

Identify the key attributes in this table:

Identify the non-key attributes in this table:

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

Redesign this database so that it is in 2NF

COURSES AVAILABLE:

COURSE:

© www.teach-ict.com All Rights Reserved


© www.teach-ict.com All Rights Reserved
Third Normal Form (3NF)

The rules for 3NF:

• The table must be in 2NF


• There are no non-key attributes that depend on another non-key
attribute
• Every non-key attribute is non-transitively dependent on the primary
key

Example 1: Concert table

Venue* Artist* Date* Attendance Profit City Country

Wembley Girls 14/05/09 23000 12334 London UK


Aloud
NEC Leona 18/05/09 15000 43025 Birmingham UK
Lewis
Carnegie Girls 20/05/09 13453 16785 New York USA
Hall Aloud

Key attributes: Venue, Artist, Date

Non-key attributes: Attendance, Profit, City, Country

The table is in 2NF but it is not in 3NF because ‘Country’ could be derived
from ‘City’

Country could be stored in another table e.g.

City* Country

London UK

Birmingham UK

New York USA

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

© www.teach-ict.com All Rights Reserved


COURSES AVAILABLE:
CourseID* Term* PlacesAvailable TeacherID Teacher
001 Autumn 50 024 Mrs White
001 Spring 40 024 Mrs White
001 Summer 45 019 Mr Brown
002 Autumn 100 024 Mrs White
002 Spring 90 031 Miss Green
003 Summer 100 026 Mr Black

Is this table in 3NF?

If you answered ‘no’, explain your reason.

Redesign this database so that it is in 3NF

COURSES AVAILABLE

TEACHER

© www.teach-ict.com All Rights Reserved

You might also like