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

database Normalization
database Normalizationdatabase Normalization
database Normalization
Harsiddhi Thakkar
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
Syed Zaid Irshad
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
Jafar Nesargi
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational Calculus
Kunal Anand
 
Inner join and outer join
Inner join and outer joinInner join and outer join
Inner join and outer join
Nargis Ehsan
 
Advance database system (part 3)
Advance database system (part 3)Advance database system (part 3)
Advance database system (part 3)
Abdullah Khosa
 
Number system and its conversions
Number system and its conversionsNumber system and its conversions
Number system and its conversions
ShilpaKrishna6
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Arun Sharma
 
Chapter 3 Entity Relationship Model
Chapter 3 Entity Relationship ModelChapter 3 Entity Relationship Model
Chapter 3 Entity Relationship Model
Eddyzulham Mahluzydde
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
GirdharRatne
 
Data Structure - Elementary Data Organization
Data Structure - Elementary  Data Organization Data Structure - Elementary  Data Organization
Data Structure - Elementary Data Organization
Uma mohan
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
Bhandari Nawaraj
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
Mohan Kumar.R
 
Creating and Managing Tables -Oracle Data base
Creating and Managing Tables -Oracle Data base Creating and Managing Tables -Oracle Data base
Creating and Managing Tables -Oracle Data base
Salman Memon
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
Rahul Narang
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
sinhacp
 
Dbms
DbmsDbms
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
Ravinder Kamboj
 
Integrity constraints in dbms
Integrity constraints in dbmsIntegrity constraints in dbms
Integrity constraints in dbms
Vignesh Saravanan
 
Structure c
Structure cStructure c
Structure c
thirumalaikumar3
 

What's hot (20)

database Normalization
database Normalizationdatabase Normalization
database Normalization
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational Calculus
 
Inner join and outer join
Inner join and outer joinInner join and outer join
Inner join and outer join
 
Advance database system (part 3)
Advance database system (part 3)Advance database system (part 3)
Advance database system (part 3)
 
Number system and its conversions
Number system and its conversionsNumber system and its conversions
Number system and its conversions
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Chapter 3 Entity Relationship Model
Chapter 3 Entity Relationship ModelChapter 3 Entity Relationship Model
Chapter 3 Entity Relationship Model
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Data Structure - Elementary Data Organization
Data Structure - Elementary  Data Organization Data Structure - Elementary  Data Organization
Data Structure - Elementary Data Organization
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
 
Creating and Managing Tables -Oracle Data base
Creating and Managing Tables -Oracle Data base Creating and Managing Tables -Oracle Data base
Creating and Managing Tables -Oracle Data base
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
 
Dbms
DbmsDbms
Dbms
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
Integrity constraints in dbms
Integrity constraints in dbmsIntegrity constraints in dbms
Integrity constraints in dbms
 
Structure c
Structure cStructure c
Structure c
 

Viewers also liked

Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
emailharmeet
 
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
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
Damian T. Gordon
 
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
 

Viewers also liked (20)

Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
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
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
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
 

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

Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 

Recently uploaded (20)

Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 

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.