SlideShare a Scribd company logo
1 of 14
DBMS
Normalization Examples
Example 1
Album Tracks Artist ArtistCountry
Abby Road Here comes the
sun, Octopus
Garden,
Something, etc.
Beatles UK
Blond on Blond Rainy Day
Woman, Sad
eyed lady of
the lowlands,
Stuck in
Memphis with
the mobile blues
again
Bob Dylan US
 This table could potentially fall prey to all three
anomalies. If the ArtistCountry was required,
it would be impossible to insert a new album if
you did not know the country of the artist. If
you deleted an album, you could accidently
remove all data about a given artist. Updating
tracks could be difficult and result in errors
because of the way they are listed in the cell.
 Converting a spreadsheet into a relational
database is a common task for database
developers. The task is not as straightforward
as it might seem. Although you can often
import data from a spread-sheet directly into a
database management system, spreadsheets
are almost never well designed for relational
databases
First Normal Form
 The First Normal Form [FN1] involves getting rid
of repeating groups or arrays. Each attribute
should contain only a single value of a single type.
This means a couple of things. For one, all the
values under an attribute should be about the
same thing. An attribute called ―Email,‖ for
instance, should contain emails only, no phone or
pager numbers. A second meaning is that each
value stored under an attribute should be a single
value, not an array or list of values. It would be
wrong, for example, to store two or three emails
for the same person separated by commas. An
entity is in First Normal Form if
An entity is in First Normal
Form if
 Every attribute represents only one value.
 There are no repeating groups or arrays.
 Each row is unique.
 This Album table does not meet the criteria for First
Normal Form. The main problem is in theTrack
column. The columnTrackcontains a list of songs
rather than a single value. This would make it very
difficult to locate information about any single song.
One solution that often occurs to novice database
developers is to enumerate a list of columns such as
Track1, Track2, Track3, and so on, to some arbitrary
number of tracks. This also violates the First Normal
Form by creating a repeating group. Say, for
argument’s sake, you made 13 track columns. What
happens to an album with fourteen tracks? What if an
album has only one or two tracks? Also consider what
you would need to do to find any individual track. You
would need to query 13 separate columns
Table in First Normal Form
AlbumTitle Track Artist ArtistCountr
y
Abby Road Here comes the sun Beatles UK
Abby Road Octopus’s Garden Beatles UK
Abby Road Something Beatles UK
Blond on Blond Rainy Day Woman Bob Dylan US
Blond on Blond Sad Eyed Lady of the lowlands Bob Dylan US
Blond on Blond Stuck in Mobile with the
Memphis
blues again
Bob Dylan US
First Normal Form is not sufficient. Every column contains a single value, and
there are no arrays or repeating groups, but there is a great deal of redundancy.
 In the Album table, there are really at least two
large subjects. One is the Album itself. The
other is the Track.
 The Artist information depends on the Track.
(Think about an album with tracks by multiple
artists.) To conform to the Second Normal
Form, the two functional dependencies—big
themes—must be broken into separate
entities.
 To relate the Album entity to the Track entity, it
is necessary to create a primary key for the
Album entity that can be used to create a key–
foreign key relationship with the Track entity. It
is also a good idea to give the Track entity a
primary key. Here is what the tables look like
now:
AlbumKey AlbumTitle
ABRD Abby Road
BLBLB Blond On
Blond
TrackK
ey
Track AlbumKe
y
Artist ArtistCountr
y
HCTS Here comes the sun ABRD Beatles UK
OPGD Octopus’s Garden ABRD Beatles UK
SMTH Something ABRD Beatles UK
RDWM Rainy Day Woman BLBL Bob
Dylan
US
SELL Sad Eyed Lady of the
lowlands
BLBL Bob
Dylan
US
SMMB Stuck in Mobile with the
Memphis
blues again
BLBL Bob
Dylan
US
Third Normal Form
 For an entity to be in Third Normal Form, it has to
first be in Second Normal Form. Third Normal
Form is about removing “transitive
dependencies.” A transitive dependency
describes an attribute that depends on another
attribute—not the primary key—for its eaning. The
idea is that every attribute should directly describe
the entity itself. If you have a Customer entity,
every attribute should describe the customer.
There shouldn’t be any attributes that describe
another attribute.
 While transitive dependencies may seem trivial,
they do add to redundancy and therefore open the
possibilities for update and other anomalies.
 There is a transitive dependency in the table.
ArtistCountry doesn’t describe the track; it
describes the Artist. The solution, as usual, is
to break out a separate table. Artist should be
its own entity.
AlbumKey AlbumTitle
ABRD Abby Road
BLBLB Blond On
Blond
ArtistKey ArtistName ArtistCount
ry
BTLS Beatles UK
BDLN Bob Dylan US
ArtistAlbum
Track-Table 3NF
Track
Key
Track Album
Key
Artist
Key
HCTS Here comes the
sun
ABRD BTLS
OPG
D
Octopus’s Garden ABRD BTLS
SMT
H
Something ABRD BTLS
RDW
M
Rainy Day
Woman
BLBL BDLN
SELL Sad Eyed Lady of
the lowlands
BLBL BDLN
SMM
B
Stuck in Mobile
with the Memphis
BLBL BDLN

More Related Content

Viewers also liked

00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabus00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabus
Bishal Ghimire
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01
Jotham Gadot
 

Viewers also liked (10)

00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabus00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabus
 
Advanced Arel: When ActiveRecord Just Isn't Enough
Advanced Arel: When ActiveRecord Just Isn't EnoughAdvanced Arel: When ActiveRecord Just Isn't Enough
Advanced Arel: When ActiveRecord Just Isn't Enough
 
Fundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureFundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and Architecture
 
01.01 introduction to database
01.01 introduction to database01.01 introduction to database
01.01 introduction to database
 
Database language
Database languageDatabase language
Database language
 
Database management system basic, database, database management, learn databa...
Database management system basic, database, database management, learn databa...Database management system basic, database, database management, learn databa...
Database management system basic, database, database management, learn databa...
 
Fundamentals of Database system
Fundamentals of Database systemFundamentals of Database system
Fundamentals of Database system
 
Chapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemChapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management System
 
Database management system
Database management systemDatabase management system
Database management system
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01
 

More from Bishal Ghimire

07.03 cartesian product
07.03 cartesian product07.03 cartesian product
07.03 cartesian product
Bishal Ghimire
 
07.02 relational union intersection
07.02 relational union intersection07.02 relational union intersection
07.02 relational union intersection
Bishal Ghimire
 
07.01 relational algebra
07.01 relational algebra07.01 relational algebra
07.01 relational algebra
Bishal Ghimire
 
07.01 relational algebra
07.01 relational algebra07.01 relational algebra
07.01 relational algebra
Bishal Ghimire
 
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
Bishal Ghimire
 
02.02 querying relational database
02.02 querying relational database02.02 querying relational database
02.02 querying relational database
Bishal Ghimire
 
02.01 relational databases
02.01 relational databases02.01 relational databases
02.01 relational databases
Bishal Ghimire
 

More from Bishal Ghimire (15)

Counseling Ethics in Astrology for better Mental Health
Counseling Ethics in Astrology for better Mental HealthCounseling Ethics in Astrology for better Mental Health
Counseling Ethics in Astrology for better Mental Health
 
Agile Intro to Manifesto - Values 1 - Interaction over Process
Agile Intro to Manifesto - Values 1 - Interaction over ProcessAgile Intro to Manifesto - Values 1 - Interaction over Process
Agile Intro to Manifesto - Values 1 - Interaction over Process
 
Earthquake in Nepal 2015
Earthquake in Nepal 2015Earthquake in Nepal 2015
Earthquake in Nepal 2015
 
07.05 division
07.05 division07.05 division
07.05 division
 
07.04 joins
07.04 joins07.04 joins
07.04 joins
 
07.03 cartesian product
07.03 cartesian product07.03 cartesian product
07.03 cartesian product
 
07.02 relational union intersection
07.02 relational union intersection07.02 relational union intersection
07.02 relational union intersection
 
07.01 relational algebra
07.01 relational algebra07.01 relational algebra
07.01 relational algebra
 
07.01 relational algebra
07.01 relational algebra07.01 relational algebra
07.01 relational algebra
 
09.01 normalization
09.01 normalization09.01 normalization
09.01 normalization
 
06.02 sql alias
06.02 sql alias06.02 sql alias
06.02 sql alias
 
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
 
04.01 file organization
04.01 file organization04.01 file organization
04.01 file organization
 
02.02 querying relational database
02.02 querying relational database02.02 querying relational database
02.02 querying relational database
 
02.01 relational databases
02.01 relational databases02.01 relational databases
02.01 relational databases
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 

09.02 normalization example

  • 2. Example 1 Album Tracks Artist ArtistCountry Abby Road Here comes the sun, Octopus Garden, Something, etc. Beatles UK Blond on Blond Rainy Day Woman, Sad eyed lady of the lowlands, Stuck in Memphis with the mobile blues again Bob Dylan US
  • 3.  This table could potentially fall prey to all three anomalies. If the ArtistCountry was required, it would be impossible to insert a new album if you did not know the country of the artist. If you deleted an album, you could accidently remove all data about a given artist. Updating tracks could be difficult and result in errors because of the way they are listed in the cell.
  • 4.  Converting a spreadsheet into a relational database is a common task for database developers. The task is not as straightforward as it might seem. Although you can often import data from a spread-sheet directly into a database management system, spreadsheets are almost never well designed for relational databases
  • 5. First Normal Form  The First Normal Form [FN1] involves getting rid of repeating groups or arrays. Each attribute should contain only a single value of a single type. This means a couple of things. For one, all the values under an attribute should be about the same thing. An attribute called ―Email,‖ for instance, should contain emails only, no phone or pager numbers. A second meaning is that each value stored under an attribute should be a single value, not an array or list of values. It would be wrong, for example, to store two or three emails for the same person separated by commas. An entity is in First Normal Form if
  • 6. An entity is in First Normal Form if  Every attribute represents only one value.  There are no repeating groups or arrays.  Each row is unique.
  • 7.  This Album table does not meet the criteria for First Normal Form. The main problem is in theTrack column. The columnTrackcontains a list of songs rather than a single value. This would make it very difficult to locate information about any single song. One solution that often occurs to novice database developers is to enumerate a list of columns such as Track1, Track2, Track3, and so on, to some arbitrary number of tracks. This also violates the First Normal Form by creating a repeating group. Say, for argument’s sake, you made 13 track columns. What happens to an album with fourteen tracks? What if an album has only one or two tracks? Also consider what you would need to do to find any individual track. You would need to query 13 separate columns
  • 8. Table in First Normal Form AlbumTitle Track Artist ArtistCountr y Abby Road Here comes the sun Beatles UK Abby Road Octopus’s Garden Beatles UK Abby Road Something Beatles UK Blond on Blond Rainy Day Woman Bob Dylan US Blond on Blond Sad Eyed Lady of the lowlands Bob Dylan US Blond on Blond Stuck in Mobile with the Memphis blues again Bob Dylan US First Normal Form is not sufficient. Every column contains a single value, and there are no arrays or repeating groups, but there is a great deal of redundancy.
  • 9.  In the Album table, there are really at least two large subjects. One is the Album itself. The other is the Track.  The Artist information depends on the Track. (Think about an album with tracks by multiple artists.) To conform to the Second Normal Form, the two functional dependencies—big themes—must be broken into separate entities.
  • 10.  To relate the Album entity to the Track entity, it is necessary to create a primary key for the Album entity that can be used to create a key– foreign key relationship with the Track entity. It is also a good idea to give the Track entity a primary key. Here is what the tables look like now: AlbumKey AlbumTitle ABRD Abby Road BLBLB Blond On Blond
  • 11. TrackK ey Track AlbumKe y Artist ArtistCountr y HCTS Here comes the sun ABRD Beatles UK OPGD Octopus’s Garden ABRD Beatles UK SMTH Something ABRD Beatles UK RDWM Rainy Day Woman BLBL Bob Dylan US SELL Sad Eyed Lady of the lowlands BLBL Bob Dylan US SMMB Stuck in Mobile with the Memphis blues again BLBL Bob Dylan US
  • 12. Third Normal Form  For an entity to be in Third Normal Form, it has to first be in Second Normal Form. Third Normal Form is about removing “transitive dependencies.” A transitive dependency describes an attribute that depends on another attribute—not the primary key—for its eaning. The idea is that every attribute should directly describe the entity itself. If you have a Customer entity, every attribute should describe the customer. There shouldn’t be any attributes that describe another attribute.  While transitive dependencies may seem trivial, they do add to redundancy and therefore open the possibilities for update and other anomalies.
  • 13.  There is a transitive dependency in the table. ArtistCountry doesn’t describe the track; it describes the Artist. The solution, as usual, is to break out a separate table. Artist should be its own entity. AlbumKey AlbumTitle ABRD Abby Road BLBLB Blond On Blond ArtistKey ArtistName ArtistCount ry BTLS Beatles UK BDLN Bob Dylan US ArtistAlbum
  • 14. Track-Table 3NF Track Key Track Album Key Artist Key HCTS Here comes the sun ABRD BTLS OPG D Octopus’s Garden ABRD BTLS SMT H Something ABRD BTLS RDW M Rainy Day Woman BLBL BDLN SELL Sad Eyed Lady of the lowlands BLBL BDLN SMM B Stuck in Mobile with the Memphis BLBL BDLN