+ All Categories
Home > Documents > Normalisation

Normalisation

Date post: 19-Jan-2016
Category:
Upload: corin
View: 40 times
Download: 0 times
Share this document with a friend
Description:
Normalisation. Ham Ham’s Hammy Club. Introduction. What is normalisation? “a technique for designing relational database tables to minimize duplication of information and, in so doing, to safeguard the database against certain types of logical or structural problems” wikipedia.com. - PowerPoint PPT Presentation
Popular Tags:
19
Ham Ham’s Hammy Club
Transcript
Page 1: Normalisation

Ham Ham’s Hammy Club

Page 2: Normalisation

• What is normalisation?

“a technique for designing relational database tables to minimize duplication of information and, in so doing, to safeguard the database against certain types of logical or structural problems”

wikipedia.com

Page 3: Normalisation

MemberID: Initial:Surname:Title:Sex:Postcode:Tel No:

Hammy Details:

Name Sex DofB Breed Origen of Breed Breed life expectancy

I’m kind of a big deal!

Page 4: Normalisation

MemberID: 0001Initial: ASurname: DolinskiTitle: MrSex: MalePostcode: HA1 HA1Tel No: 0123456789

Hammy Details:

Name Sex DofB Breed Origen of Breed Breed life expectancy

Michelle Schuhamster

F 11.10.2007 Syrian Syria 2-3

Stormy F 26.11.2007 Syrian Syria 2-3

Minnie F 25.04.2009 Syrian Syria 2-3

Biscuit M 25.04.2009 Russian Dwarf Russia 1-2

I’m kind of a big deal!

Page 5: Normalisation

• Hamster can have one owner• Owners can have many hamsters

HamsterHamster OwnerOwner

Page 6: Normalisation

• A hamster can only be one breed• A breed can have many hamsters

HamsterHamster BreedBreed

Page 7: Normalisation

HamsterHamster BreedBreed

OwnerOwner

Page 8: Normalisation

MemberID: 0001Initial: ASurname: DolinskiTitle: MrSex: MalePostcode: HA1 HA1Tel No: 0123456789

Hammy Details:

Name Sex DofB Breed Origen of Breed Breed life expectancy

Michelle Schuhamster

F 11.10.2007 Syrian Syria 2-3

Stormy F 26.11.2007 Syrian Syria 2-3

Minnie F 25.04.2009 Syrian Syria 2-3

Biscuit M 25.04.2009 Russian Dwarf Russia 1-2

I’m kind of a big deal!

We can see we already have issues with repeated data!

Page 9: Normalisation

MID Initial LastName

Title Sex PostCode

Tel HamName

HamSex

DOB Breed Origin LifeExp.

0001 A Dolinski Mr M HA1HA1

0123456789

Schuey F 11.10.2007

Syrian Syria 2-3

0001 A Dolinski Mr M HA1HA1

0123456789

Stormy F 26.11.2007

Syrian Syria 2-3

0001 A Dolinski Mr M HA1HA1

0123456789

Minnie F 25.04.2009

Syrian Syria 2-3

0001 A Dolinski Mr M HA1HA1

0123456789

Biscuit M 25.04.2009

R. Dwarf

Russia 1-2

0002 L Pibski Miss F FU1BA4

9876543210

Flabs M 13.05.2008

C.Dward

China 1-3

0002 L Pibski Miss F FU1BA4

9876543210

Babs F 17.02.2008

Syrian Syria 2-3

0003 S Gatti MS F QW3RT7

4651327980

Kebabs M 28.09.2007

R.Dwarf

Russia 1-2

... ... ... ... ... ... ... ... ... ... ... ... ...

... ... ... ... ... ... ... ... ... ... ... ... ...

Page 10: Normalisation

MID Initial LastName

Title Sex PostCode

Tel HamName

HamSex

DOB Breed Origin LifeExp.

0001 A Dolinski Mr M HA1HA1

0123456789

Schuey F 11.10.2007

Syrian Syria 2-3

0001 A Dolinski Mr M HA1HA1

0123456789

Stormy F 26.11.2007

Syrian Syria 2-3

0001 A Dolinski Mr M HA1HA1

0123456789

Minnie F 25.04.2009

Syrian Syria 2-3

0001 A Dolinski Mr M HA1HA1

0123456789

Biscuit M 25.04.2009

R. Dwarf

Russia 1-2

0002 L Pibski Miss F FU1BA4

9876543210

Flabs M 13.05.2008

C.Dward

China 1-3

0002 L Pibski Miss F FU1BA4

9876543210

Babs F 17.02.2008

Syrian Syria 2-3

0003 S Gatti MS F QW3RT7

4651327980

Kebabs M 28.09.2007

R.Dwarf

Russia 1-2

... ... ... ... ... ... ... ... ... ... ... ... ...

... ... ... ... ... ... ... ... ... ... ... ... ...

Customer information is

repeated

Page 11: Normalisation

MID Initial LastName

Title Sex PostCode

Tel HamName

HamSex

DOB Breed Origin LifeExp.

0001 A Dolinski Mr M HA1HA1

0123456789

Schuey F 11.10.2007

Syrian Syria 2-3

0001 A Dolinski Mr M HA1HA1

0123456789

Stormy F 26.11.2007

Syrian Syria 2-3

0001 A Dolinski Mr M HA1HA1

0123456789

Minnie F 25.04.2009

Syrian Syria 2-3

0001 A Dolinski Mr M HA1HA1

0123456789

Biscuit M 25.04.2009

R. Dwarf

Russia 1-2

0002 L Pibski Miss F FU1BA4

9876543210

Flabs M 13.05.2008

C.Dward

China 1-3

0002 L Pibski Miss F FU1BA4

9876543210

Babs F 17.02.2008

Syrian Syria 2-3

0003 S Gatti MS F QW3RT7

4651327980

Kebabs M 28.09.2007

R.Dwarf

Russia 1-2

... ... ... ... ... ... ... ... ... ... ... ... ...

... ... ... ... ... ... ... ... ... ... ... ... ...

Breed information is repeated

Page 12: Normalisation
Page 13: Normalisation
Page 14: Normalisation
Page 15: Normalisation

In some cases, you may need to add a new field to make a compound primary key.

In some cases, you may need to add a new field to make a compound primary key.

Page 16: Normalisation

This fixes the many-to-many problem!This fixes the many-to-many problem!

Page 17: Normalisation

Here we have a foreign key – a non-primary key that links to a primary key in another table.

Here we have a foreign key – a non-primary key that links to a primary key in another table.

Page 18: Normalisation
Page 19: Normalisation

• You don’t actually need to know how to normalise a database. It’s useful to know though because you’ll have a better understanding of it – it’ll also help in coursework!

• However, you need to know the advantages of doing so and you’ll need to know the rules.


Recommended