SlideShare a Scribd company logo
NORMALIZATION
Instructor:
Mehwashma Amir
E-R Model and Normalization/ Session 2
1
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
2E-R Model and Normalization/ Session 2
 Initially, all databases are characterized by large number of columns and records.
 This approach has certain drawbacks.
 The following table consist of details of the employees and the project they are
working on.
Repetition Anomaly
 The data such as Project_id, Project_name, Grade, and Salary repeat
many times.
 This repetition hampers both, performance during retrieval of data and the storage
capacity.
 This repetition of data is called the repetition anomaly.
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
3E-R Model and Normalization/ Session 2
 The repetition is shown in the following table with the help of shaded cells:
Insertion Anomaly
 Suppose the department recruits a new employee named Ann.
 Consider that Ann has not been assigned any project. Insertion of her details in the
table would leave columns Project_id and Project_name empty.
 Leaving columns blank could lead to problems later.
 Anomalies created by such insertions are called insertion anomalies as shown in
the following table:
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
4E-R Model and Normalization/ Session 2
Deletion Anomaly
 Suppose, Bob is relieved from the project MAGNUM.
 Deleting the record deletes Bob's Emp_no, Grade, and Salary details too.
 This loss of data is harmful as all of Bob's personal details are also lost.
 This kind of loss of data due to deletion is called deletion anomaly as can be seen in
the following table:
Updating Anomaly
 Suppose John was given a hike in Salary or John was demoted.
 The change in John's Salary or Grade needs to be reflected in all projects John
works for.
 This problem in updating all the occurrences is called updating anomaly.
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
5E-R Model and Normalization/ Session 2
The Department Employee Details table is called an unnormalized table.
These drawbacks lead to the need for normalization.
Normalization is the process of removing unwanted redundancy and dependencies.
Initially, Codd (1972) presented three normal forms (1NF, 2NF, and 3NF), all based
on dependencies among the attributes of a relation.
The fourth and fifth normal forms are based on multi value and join dependencies
and were proposed later.
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
6E-R Model and Normalization/ Session 2
1
• Create separate tables for each group of related data.
2
• The table columns must have atomic values.
3
• All the key attributes must be identified.
 In order to achieve the first normal form, following steps need to be performed:
 Consider the Employee Project Details table as follows:
 The table has data related to projects and employees.
 The table needs to be split into two tables, that is, a Project Details table
and an Employee Details table.
 The table columns, Project_id and Project_names, have multiple values.
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
7E-R Model and Normalization/ Session 2
 The data needs to be split over different rows.
 The resultant tables are Project Details and Employee Details as
follows:
Project Details
Employee Details
 The Project_id attribute is the primary key for the Project Details table.
 The Emp_no attribute is the primary key for the Employee Details table.
 Therefore, in first normal form, the initial Employee Project Details table
has been reduced to the Project Details and Employee Details tables.
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
8E-R Model and Normalization/ Session 2
 The tables are said to be in second normal form if:
 Partial dependency means a non-key attribute should not be partially dependent
on more than one key attribute.
 The Project Details and Employee Details tables do not exhibit any
partial dependencies.
 The Project_name is dependent only on Project_id and Emp_name,
Grade, and Salary are dependant only on Emp_no.
 The tables also need to be related through foreign keys.
 A third table, named Employee Project Details, is created with only two
columns, Project_id and Emp_no.
They meet the requirements of the first normal form.
There are no partial dependencies in the tables.
The tables are related through foreign keys.
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
9E-R Model and Normalization/ Session 2
 So, the project and employee details tables on conversion to second normal form
generates tables Project Details, Employee Details, and Employee
Project Details as follows:
Project Details
Employee Project Details
Employee Details
 The attributes, Emp_no and Project_id, of the Employee Project
Details table combine together to form the primary key.
 Such primary keys are called composite primary keys.
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
10E-R Model and Normalization/ Session 2
 To achieve the third normal form:
The tables should meet the requirements of the second normal form
The tables should not have transitive dependencies in them
 The Project Details, Employee Details, and Employee Project
Details tables are in second normal form.
 If an attribute can be determined by another non-key attribute, it is called a
transitive dependency.
 That is, every non-key attribute should be determined by the key attribute only.
 If a non-key attribute can be determined by another non-key attribute, it needs to
put into another table.
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
11E-R Model and Normalization/ Session 2
 On observing the different tables, it is seen that the Project Details and
Employee Project Details tables do not exhibit any such transitive
dependencies.
 The non-key attributes are totally determined by the key attributes.
 Project_name is only determined by Project_number.
 On further scrutinizing the Employee Details table, a certain inconsistency is
seen.
 The attribute Salary is determined by the attribute Grade and not the key
attribute Emp_no.
 Thus, this transitive dependency needs to be removed.
 The Employee Details table can be split into Employee Details and
Grade Salary Details tables as follows:
Employee Details Grade Salary Details
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
12E-R Model and Normalization/ Session 2
 Thus, at the end of the three normalization stages, the initial Employee
Project Details table has been reduced to the Project Details,
Employee Project Details, Employee Details, and Grade Salary
Details tables as follows:
Employee Details Grade Salary Details
Project Details
Employee Project Details
SQL
Server
2012
© Aptech Ltd.
SQL
Server
2012
13E-R Model and Normalization/ Session 2
By normalizing a database, redundancy is reduced.
This, in turn, reduces the storage requirements for the database and ensures data
integrity.
However, it has following drawbacks:
Complex join queries may have to be written often to combine the data in
multiple tables.
Joins may practically involve more than three tables depending on the need
for information.
 If such joins are used very often, the performance of the database will become very
poor.
 In such cases, storing a few fields redundantly can be ignored to increase the
performance of the database.
 The databases that possess such minor redundancies in order to increase
performance are called denormalized databases and the process of doing so is
called denormalization.

More Related Content

What's hot

Types of normalization
Types of normalizationTypes of normalization
Types of normalization
PratibhaRashmiSingh
 
Normalization
NormalizationNormalization
Normalization
Altafsoomro
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
Kabindra Koirala
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
Bhandari Nawaraj
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
emailharmeet
 
Learn Normalization in simple language
Learn Normalization in simple languageLearn Normalization in simple language
Learn Normalization in simple language
FirstWire Apps
 
ER MODEL
ER MODELER MODEL
ER MODEL
Rupali Rana
 
Database Indexes
Database IndexesDatabase Indexes
Database Indexes
Sperasoft
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
Damian T. Gordon
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
Entity Relationship design issues
Entity Relationship design issuesEntity Relationship design issues
Entity Relationship design issues
Megha Sharma
 
Indexing and Hashing
Indexing and HashingIndexing and Hashing
Indexing and Hashing
sathish sak
 
MS Sql Server: Joining Databases
MS Sql Server: Joining DatabasesMS Sql Server: Joining Databases
MS Sql Server: Joining Databases
DataminingTools Inc
 
Sql join
Sql  joinSql  join
Sql join
Vikas Gupta
 
08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS
koolkampus
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Rakhi Mukherji
 
SQL Views
SQL ViewsSQL Views
Structured Query Language (SQL)
Structured Query Language (SQL)Structured Query Language (SQL)
Structured Query Language (SQL)
Syed Hassan Ali
 
Dbms classification according to data models
Dbms classification according to data modelsDbms classification according to data models
Dbms classification according to data models
ABDUL KHALIQ
 
Bsc cs ii-dbms-u-iv-normalization
Bsc cs ii-dbms-u-iv-normalizationBsc cs ii-dbms-u-iv-normalization
Bsc cs ii-dbms-u-iv-normalization
Rai University
 

What's hot (20)

Types of normalization
Types of normalizationTypes of normalization
Types of normalization
 
Normalization
NormalizationNormalization
Normalization
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
Learn Normalization in simple language
Learn Normalization in simple languageLearn Normalization in simple language
Learn Normalization in simple language
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
Database Indexes
Database IndexesDatabase Indexes
Database Indexes
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Relational model
Relational modelRelational model
Relational model
 
Entity Relationship design issues
Entity Relationship design issuesEntity Relationship design issues
Entity Relationship design issues
 
Indexing and Hashing
Indexing and HashingIndexing and Hashing
Indexing and Hashing
 
MS Sql Server: Joining Databases
MS Sql Server: Joining DatabasesMS Sql Server: Joining Databases
MS Sql Server: Joining Databases
 
Sql join
Sql  joinSql  join
Sql join
 
08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Structured Query Language (SQL)
Structured Query Language (SQL)Structured Query Language (SQL)
Structured Query Language (SQL)
 
Dbms classification according to data models
Dbms classification according to data modelsDbms classification according to data models
Dbms classification according to data models
 
Bsc cs ii-dbms-u-iv-normalization
Bsc cs ii-dbms-u-iv-normalizationBsc cs ii-dbms-u-iv-normalization
Bsc cs ii-dbms-u-iv-normalization
 

Viewers also liked

Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Ehsan Hamzei
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Oum Saokosal
 
Normalization of database tables
Normalization of database tablesNormalization of database tables
Normalization of database tables
Dhani Ahmad
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Rathan Raj
 
Database - Normalization
Database - NormalizationDatabase - Normalization
Database - Normalization
Mudasir Qazi
 
Normalization
NormalizationNormalization
Normalization
Salman Memon
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
Jargalsaikhan Alyeksandr
 
Normalization of database_tables_chapter_4
Normalization of database_tables_chapter_4Normalization of database_tables_chapter_4
Normalization of database_tables_chapter_4
Farhan Chishti
 
Database normalization
Database normalizationDatabase normalization
Database normalization
Edward Blurock
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
Prateek Parimal
 
Entity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationEntity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalization
Satya Pal
 
DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
Jitendra Tomar
 
Information system in global business
Information system in global business  Information system in global business
Information system in global business
Unitedworld School Of Business
 
Database Join
Database JoinDatabase Join
Database Join
Farooq Mian
 
Sub join a query optimization algorithm for flash-based database
Sub join a query optimization algorithm for flash-based databaseSub join a query optimization algorithm for flash-based database
Sub join a query optimization algorithm for flash-based database
Zhichao Liang
 
b - Normalizing a Data Model
b - Normalizing a Data Modelb - Normalizing a Data Model
b - Normalizing a Data Model
Dimara Hakim
 
Dbm 380 week 3 learning team ms access tables
Dbm 380 week 3 learning team ms access tablesDbm 380 week 3 learning team ms access tables
Dbm 380 week 3 learning team ms access tables
raichanara1973
 
Database Introduction - Join Query
Database Introduction - Join QueryDatabase Introduction - Join Query
Database Introduction - Join Query
Dudy Ali
 
multi-threading
multi-threadingmulti-threading
multi-threading
Ezzat Gul
 
Scrum Model
Scrum ModelScrum Model
Scrum Model
Farooq Mian
 

Viewers also liked (20)

Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Normalization of database tables
Normalization of database tablesNormalization of database tables
Normalization of database tables
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Database - Normalization
Database - NormalizationDatabase - Normalization
Database - Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Normalization of database_tables_chapter_4
Normalization of database_tables_chapter_4Normalization of database_tables_chapter_4
Normalization of database_tables_chapter_4
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Entity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationEntity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalization
 
DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
 
Information system in global business
Information system in global business  Information system in global business
Information system in global business
 
Database Join
Database JoinDatabase Join
Database Join
 
Sub join a query optimization algorithm for flash-based database
Sub join a query optimization algorithm for flash-based databaseSub join a query optimization algorithm for flash-based database
Sub join a query optimization algorithm for flash-based database
 
b - Normalizing a Data Model
b - Normalizing a Data Modelb - Normalizing a Data Model
b - Normalizing a Data Model
 
Dbm 380 week 3 learning team ms access tables
Dbm 380 week 3 learning team ms access tablesDbm 380 week 3 learning team ms access tables
Dbm 380 week 3 learning team ms access tables
 
Database Introduction - Join Query
Database Introduction - Join QueryDatabase Introduction - Join Query
Database Introduction - Join Query
 
multi-threading
multi-threadingmulti-threading
multi-threading
 
Scrum Model
Scrum ModelScrum Model
Scrum Model
 

Similar to Normalization in Database

Sql Server 2000
Sql Server 2000Sql Server 2000
Sql Server 2000
Om Vikram Thapa
 
Dba2 spec
Dba2 specDba2 spec
Dba2 spec
Sandeep Ratnam
 
Handling errors in t sql code (1)
Handling errors in t sql code (1)Handling errors in t sql code (1)
Handling errors in t sql code (1)
Ris Fernandez
 
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
ChristopherBow2
 
Database Modeling presentation
Database Modeling  presentationDatabase Modeling  presentation
Database Modeling presentation
Bhavishya Tyagi
 
Migrate Microsoft Access to SQL Server
Migrate Microsoft Access to SQL ServerMigrate Microsoft Access to SQL Server
Migrate Microsoft Access to SQL Server
ADNUG
 
Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql server
Vinay Thota
 
Arrays and lists in sql server 2008
Arrays and lists in sql server 2008Arrays and lists in sql server 2008
Arrays and lists in sql server 2008
nxthuong
 
Chapter – 3 Database Design P-II.pdf
Chapter – 3 Database Design P-II.pdfChapter – 3 Database Design P-II.pdf
Chapter – 3 Database Design P-II.pdf
TamiratDejene1
 
Merging data (1)
Merging data (1)Merging data (1)
Merging data (1)
Ris Fernandez
 
A
AA
1. What two conditions must be met before an entity can be classif.docx
1. What two conditions must be met before an entity can be classif.docx1. What two conditions must be met before an entity can be classif.docx
1. What two conditions must be met before an entity can be classif.docx
jackiewalcutt
 
Module 4_PART1.pptx
Module 4_PART1.pptxModule 4_PART1.pptx
Module 4_PART1.pptx
Haso12
 
Vaastav talwar a010145020052 adbms psda vaastav talwar
Vaastav talwar a010145020052 adbms psda   vaastav talwarVaastav talwar a010145020052 adbms psda   vaastav talwar
Vaastav talwar a010145020052 adbms psda vaastav talwar
Shambhavi Vats
 
SQL Query Interview Questions
SQL Query Interview QuestionsSQL Query Interview Questions
SQL Query Interview Questions
soniajessica2
 
Normalization.ppt What is Normalizations
Normalization.ppt What is NormalizationsNormalization.ppt What is Normalizations
Normalization.ppt What is Normalizations
SHAKIR325211
 
uniT 4 (1).pptx
uniT 4 (1).pptxuniT 4 (1).pptx
uniT 4 (1).pptx
YashWaghmare27
 
ABC Architecture A New Approach To Build Reusable And Adaptable Business Tie...
ABC Architecture  A New Approach To Build Reusable And Adaptable Business Tie...ABC Architecture  A New Approach To Build Reusable And Adaptable Business Tie...
ABC Architecture A New Approach To Build Reusable And Adaptable Business Tie...
Joshua Gorinson
 
Instructions sc access_1a[1]
Instructions sc access_1a[1]Instructions sc access_1a[1]
Instructions sc access_1a[1]
gaaaaaaaasa
 
New features of sql server 2005
New features of sql server 2005New features of sql server 2005
New features of sql server 2005
Govind Raj
 

Similar to Normalization in Database (20)

Sql Server 2000
Sql Server 2000Sql Server 2000
Sql Server 2000
 
Dba2 spec
Dba2 specDba2 spec
Dba2 spec
 
Handling errors in t sql code (1)
Handling errors in t sql code (1)Handling errors in t sql code (1)
Handling errors in t sql code (1)
 
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
 
Database Modeling presentation
Database Modeling  presentationDatabase Modeling  presentation
Database Modeling presentation
 
Migrate Microsoft Access to SQL Server
Migrate Microsoft Access to SQL ServerMigrate Microsoft Access to SQL Server
Migrate Microsoft Access to SQL Server
 
Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql server
 
Arrays and lists in sql server 2008
Arrays and lists in sql server 2008Arrays and lists in sql server 2008
Arrays and lists in sql server 2008
 
Chapter – 3 Database Design P-II.pdf
Chapter – 3 Database Design P-II.pdfChapter – 3 Database Design P-II.pdf
Chapter – 3 Database Design P-II.pdf
 
Merging data (1)
Merging data (1)Merging data (1)
Merging data (1)
 
A
AA
A
 
1. What two conditions must be met before an entity can be classif.docx
1. What two conditions must be met before an entity can be classif.docx1. What two conditions must be met before an entity can be classif.docx
1. What two conditions must be met before an entity can be classif.docx
 
Module 4_PART1.pptx
Module 4_PART1.pptxModule 4_PART1.pptx
Module 4_PART1.pptx
 
Vaastav talwar a010145020052 adbms psda vaastav talwar
Vaastav talwar a010145020052 adbms psda   vaastav talwarVaastav talwar a010145020052 adbms psda   vaastav talwar
Vaastav talwar a010145020052 adbms psda vaastav talwar
 
SQL Query Interview Questions
SQL Query Interview QuestionsSQL Query Interview Questions
SQL Query Interview Questions
 
Normalization.ppt What is Normalizations
Normalization.ppt What is NormalizationsNormalization.ppt What is Normalizations
Normalization.ppt What is Normalizations
 
uniT 4 (1).pptx
uniT 4 (1).pptxuniT 4 (1).pptx
uniT 4 (1).pptx
 
ABC Architecture A New Approach To Build Reusable And Adaptable Business Tie...
ABC Architecture  A New Approach To Build Reusable And Adaptable Business Tie...ABC Architecture  A New Approach To Build Reusable And Adaptable Business Tie...
ABC Architecture A New Approach To Build Reusable And Adaptable Business Tie...
 
Instructions sc access_1a[1]
Instructions sc access_1a[1]Instructions sc access_1a[1]
Instructions sc access_1a[1]
 
New features of sql server 2005
New features of sql server 2005New features of sql server 2005
New features of sql server 2005
 

More from Afrasiyab Haider

How to know value of a company
How to know value of a companyHow to know value of a company
How to know value of a company
Afrasiyab Haider
 
Providing feedback for effective listening
Providing feedback for effective listeningProviding feedback for effective listening
Providing feedback for effective listening
Afrasiyab Haider
 
Rectification of errors (Financial Accounting)
Rectification of errors (Financial Accounting)Rectification of errors (Financial Accounting)
Rectification of errors (Financial Accounting)
Afrasiyab Haider
 
Octal to binary and octal to hexa decimal conversions
Octal to binary and octal to hexa decimal conversionsOctal to binary and octal to hexa decimal conversions
Octal to binary and octal to hexa decimal conversions
Afrasiyab Haider
 
RUP - Rational Unified Process
RUP - Rational Unified ProcessRUP - Rational Unified Process
RUP - Rational Unified Process
Afrasiyab Haider
 
Facts finding techniques in Database
Facts finding techniques in Database Facts finding techniques in Database
Facts finding techniques in Database
Afrasiyab Haider
 
File organization in database
File organization in databaseFile organization in database
File organization in database
Afrasiyab Haider
 
Software development life cycle
Software development life cycleSoftware development life cycle
Software development life cycle
Afrasiyab Haider
 
Expected value of random variables
Expected value of random variablesExpected value of random variables
Expected value of random variables
Afrasiyab Haider
 
Class diagram of school management system (OOP)
Class diagram of school management system (OOP)Class diagram of school management system (OOP)
Class diagram of school management system (OOP)
Afrasiyab Haider
 
What is difference between dbms and rdbms
What is difference between dbms and rdbmsWhat is difference between dbms and rdbms
What is difference between dbms and rdbms
Afrasiyab Haider
 
Database development life cycle
Database development life cycleDatabase development life cycle
Database development life cycle
Afrasiyab Haider
 
Relation of psychology and IT
Relation of psychology and ITRelation of psychology and IT
Relation of psychology and IT
Afrasiyab Haider
 
What is Psychology and variables in psychology?
What is Psychology and variables in psychology?What is Psychology and variables in psychology?
What is Psychology and variables in psychology?
Afrasiyab Haider
 
History of operating systems
History of operating systemsHistory of operating systems
History of operating systems
Afrasiyab Haider
 
Expected value of random variables
Expected value of random variablesExpected value of random variables
Expected value of random variables
Afrasiyab Haider
 
File organization in database
File organization in databaseFile organization in database
File organization in database
Afrasiyab Haider
 
Should prisoners be allowed to cast vote?
Should prisoners be allowed to cast vote?Should prisoners be allowed to cast vote?
Should prisoners be allowed to cast vote?
Afrasiyab Haider
 
Politics and martial law in pakistan
Politics and martial law in pakistanPolitics and martial law in pakistan
Politics and martial law in pakistan
Afrasiyab Haider
 
Html and its tags
Html and its tagsHtml and its tags
Html and its tags
Afrasiyab Haider
 

More from Afrasiyab Haider (20)

How to know value of a company
How to know value of a companyHow to know value of a company
How to know value of a company
 
Providing feedback for effective listening
Providing feedback for effective listeningProviding feedback for effective listening
Providing feedback for effective listening
 
Rectification of errors (Financial Accounting)
Rectification of errors (Financial Accounting)Rectification of errors (Financial Accounting)
Rectification of errors (Financial Accounting)
 
Octal to binary and octal to hexa decimal conversions
Octal to binary and octal to hexa decimal conversionsOctal to binary and octal to hexa decimal conversions
Octal to binary and octal to hexa decimal conversions
 
RUP - Rational Unified Process
RUP - Rational Unified ProcessRUP - Rational Unified Process
RUP - Rational Unified Process
 
Facts finding techniques in Database
Facts finding techniques in Database Facts finding techniques in Database
Facts finding techniques in Database
 
File organization in database
File organization in databaseFile organization in database
File organization in database
 
Software development life cycle
Software development life cycleSoftware development life cycle
Software development life cycle
 
Expected value of random variables
Expected value of random variablesExpected value of random variables
Expected value of random variables
 
Class diagram of school management system (OOP)
Class diagram of school management system (OOP)Class diagram of school management system (OOP)
Class diagram of school management system (OOP)
 
What is difference between dbms and rdbms
What is difference between dbms and rdbmsWhat is difference between dbms and rdbms
What is difference between dbms and rdbms
 
Database development life cycle
Database development life cycleDatabase development life cycle
Database development life cycle
 
Relation of psychology and IT
Relation of psychology and ITRelation of psychology and IT
Relation of psychology and IT
 
What is Psychology and variables in psychology?
What is Psychology and variables in psychology?What is Psychology and variables in psychology?
What is Psychology and variables in psychology?
 
History of operating systems
History of operating systemsHistory of operating systems
History of operating systems
 
Expected value of random variables
Expected value of random variablesExpected value of random variables
Expected value of random variables
 
File organization in database
File organization in databaseFile organization in database
File organization in database
 
Should prisoners be allowed to cast vote?
Should prisoners be allowed to cast vote?Should prisoners be allowed to cast vote?
Should prisoners be allowed to cast vote?
 
Politics and martial law in pakistan
Politics and martial law in pakistanPolitics and martial law in pakistan
Politics and martial law in pakistan
 
Html and its tags
Html and its tagsHtml and its tags
Html and its tags
 

Recently uploaded

MySQL InnoDB Storage Engine: Deep Dive - Mydbops
MySQL InnoDB Storage Engine: Deep Dive - MydbopsMySQL InnoDB Storage Engine: Deep Dive - Mydbops
MySQL InnoDB Storage Engine: Deep Dive - Mydbops
Mydbops
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptxAI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
Sunil Jagani
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
Sease
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
"What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w..."What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w...
Fwdays
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Ukraine
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
LizaNolte
 

Recently uploaded (20)

MySQL InnoDB Storage Engine: Deep Dive - Mydbops
MySQL InnoDB Storage Engine: Deep Dive - MydbopsMySQL InnoDB Storage Engine: Deep Dive - Mydbops
MySQL InnoDB Storage Engine: Deep Dive - Mydbops
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptxAI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
"What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w..."What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w...
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
 

Normalization in Database

  • 1. NORMALIZATION Instructor: Mehwashma Amir E-R Model and Normalization/ Session 2 1
  • 2. SQL Server 2012 © Aptech Ltd. SQL Server 2012 2E-R Model and Normalization/ Session 2  Initially, all databases are characterized by large number of columns and records.  This approach has certain drawbacks.  The following table consist of details of the employees and the project they are working on. Repetition Anomaly  The data such as Project_id, Project_name, Grade, and Salary repeat many times.  This repetition hampers both, performance during retrieval of data and the storage capacity.  This repetition of data is called the repetition anomaly.
  • 3. SQL Server 2012 © Aptech Ltd. SQL Server 2012 3E-R Model and Normalization/ Session 2  The repetition is shown in the following table with the help of shaded cells: Insertion Anomaly  Suppose the department recruits a new employee named Ann.  Consider that Ann has not been assigned any project. Insertion of her details in the table would leave columns Project_id and Project_name empty.  Leaving columns blank could lead to problems later.  Anomalies created by such insertions are called insertion anomalies as shown in the following table:
  • 4. SQL Server 2012 © Aptech Ltd. SQL Server 2012 4E-R Model and Normalization/ Session 2 Deletion Anomaly  Suppose, Bob is relieved from the project MAGNUM.  Deleting the record deletes Bob's Emp_no, Grade, and Salary details too.  This loss of data is harmful as all of Bob's personal details are also lost.  This kind of loss of data due to deletion is called deletion anomaly as can be seen in the following table: Updating Anomaly  Suppose John was given a hike in Salary or John was demoted.  The change in John's Salary or Grade needs to be reflected in all projects John works for.  This problem in updating all the occurrences is called updating anomaly.
  • 5. SQL Server 2012 © Aptech Ltd. SQL Server 2012 5E-R Model and Normalization/ Session 2 The Department Employee Details table is called an unnormalized table. These drawbacks lead to the need for normalization. Normalization is the process of removing unwanted redundancy and dependencies. Initially, Codd (1972) presented three normal forms (1NF, 2NF, and 3NF), all based on dependencies among the attributes of a relation. The fourth and fifth normal forms are based on multi value and join dependencies and were proposed later.
  • 6. SQL Server 2012 © Aptech Ltd. SQL Server 2012 6E-R Model and Normalization/ Session 2 1 • Create separate tables for each group of related data. 2 • The table columns must have atomic values. 3 • All the key attributes must be identified.  In order to achieve the first normal form, following steps need to be performed:  Consider the Employee Project Details table as follows:  The table has data related to projects and employees.  The table needs to be split into two tables, that is, a Project Details table and an Employee Details table.  The table columns, Project_id and Project_names, have multiple values.
  • 7. SQL Server 2012 © Aptech Ltd. SQL Server 2012 7E-R Model and Normalization/ Session 2  The data needs to be split over different rows.  The resultant tables are Project Details and Employee Details as follows: Project Details Employee Details  The Project_id attribute is the primary key for the Project Details table.  The Emp_no attribute is the primary key for the Employee Details table.  Therefore, in first normal form, the initial Employee Project Details table has been reduced to the Project Details and Employee Details tables.
  • 8. SQL Server 2012 © Aptech Ltd. SQL Server 2012 8E-R Model and Normalization/ Session 2  The tables are said to be in second normal form if:  Partial dependency means a non-key attribute should not be partially dependent on more than one key attribute.  The Project Details and Employee Details tables do not exhibit any partial dependencies.  The Project_name is dependent only on Project_id and Emp_name, Grade, and Salary are dependant only on Emp_no.  The tables also need to be related through foreign keys.  A third table, named Employee Project Details, is created with only two columns, Project_id and Emp_no. They meet the requirements of the first normal form. There are no partial dependencies in the tables. The tables are related through foreign keys.
  • 9. SQL Server 2012 © Aptech Ltd. SQL Server 2012 9E-R Model and Normalization/ Session 2  So, the project and employee details tables on conversion to second normal form generates tables Project Details, Employee Details, and Employee Project Details as follows: Project Details Employee Project Details Employee Details  The attributes, Emp_no and Project_id, of the Employee Project Details table combine together to form the primary key.  Such primary keys are called composite primary keys.
  • 10. SQL Server 2012 © Aptech Ltd. SQL Server 2012 10E-R Model and Normalization/ Session 2  To achieve the third normal form: The tables should meet the requirements of the second normal form The tables should not have transitive dependencies in them  The Project Details, Employee Details, and Employee Project Details tables are in second normal form.  If an attribute can be determined by another non-key attribute, it is called a transitive dependency.  That is, every non-key attribute should be determined by the key attribute only.  If a non-key attribute can be determined by another non-key attribute, it needs to put into another table.
  • 11. SQL Server 2012 © Aptech Ltd. SQL Server 2012 11E-R Model and Normalization/ Session 2  On observing the different tables, it is seen that the Project Details and Employee Project Details tables do not exhibit any such transitive dependencies.  The non-key attributes are totally determined by the key attributes.  Project_name is only determined by Project_number.  On further scrutinizing the Employee Details table, a certain inconsistency is seen.  The attribute Salary is determined by the attribute Grade and not the key attribute Emp_no.  Thus, this transitive dependency needs to be removed.  The Employee Details table can be split into Employee Details and Grade Salary Details tables as follows: Employee Details Grade Salary Details
  • 12. SQL Server 2012 © Aptech Ltd. SQL Server 2012 12E-R Model and Normalization/ Session 2  Thus, at the end of the three normalization stages, the initial Employee Project Details table has been reduced to the Project Details, Employee Project Details, Employee Details, and Grade Salary Details tables as follows: Employee Details Grade Salary Details Project Details Employee Project Details
  • 13. SQL Server 2012 © Aptech Ltd. SQL Server 2012 13E-R Model and Normalization/ Session 2 By normalizing a database, redundancy is reduced. This, in turn, reduces the storage requirements for the database and ensures data integrity. However, it has following drawbacks: Complex join queries may have to be written often to combine the data in multiple tables. Joins may practically involve more than three tables depending on the need for information.  If such joins are used very often, the performance of the database will become very poor.  In such cases, storing a few fields redundantly can be ignored to increase the performance of the database.  The databases that possess such minor redundancies in order to increase performance are called denormalized databases and the process of doing so is called denormalization.