SlideShare a Scribd company logo
NORMALIZATION
Normalization
 Normalization is the process of efficiently
organizing data in a database.
 Normalization is the process of applying a
series of rules to ensure that your database
achieves optimal structure.
Why we do Normalization?
 There are two goals of the normalization process:
1- eliminating redundant data
For example: storing the same data in more than
one table
2- ensuring data dependencies make sense.
For example: only storing related data in a table.
Both of these are worthy goals as they reduce the amount of
space a database consumes and ensure that data is logically
stored.
Database Anomalies:
 Repetition Anomaly
 Insertion Anomaly
 Deletion Anomaly
 Updating Anomaly
First Normal Form (1NF)
 Each attribute must be atomic
• No repeating columns within a row.
• No multi-valued columns.
 1NF simplifies attributes
• Queries become easier.
1NF
Employee (unnormalized)
emp_no emp_name project_id project_name grade salary
142 John 113, 124 blue star, magnum A 20,000
168 James 113 blue star B 15,000
263 Andrew 113 blue star C 10,000
Employee (1NF)
emp_no emp_name project_id project_name grade salary
142 John 113 blue star A 20,000
142 John 124 magnum A 20,000
168 James 113 blue star B 15,000
263 Andrew 113 blue star C 10,000
Second Normal Form (2NF)
 Each attribute must be functionally
dependent on the primary key.
• Partial Functional dependency – a non-key attribute
should not be partially(functionally) dependent on
more than one key attribute.
• Any non-dependent attributes are moved into a
smaller (subset) table.
 2NF improves data integrity.
• Prevents update, insert, and delete anomalies.
Functional Dependency
Emp_name, grade and salary are functionally
dependent only on emp_no. (emp_no -> emp_name,
grade, salary)
Project_name is dependent only on project_id.
But these table should be related through foreign
keys.
emp_no emp_name grade salary
142 John A 20,000
168 James B 15,000
263 Andrew C 10,000
109 Bob C 10,000
Employee (1NF) Project (1NF)
project_id project_name
113 blue star
124 magnum
2NF
emp_no emp_name grade salary
142 John A 20,000
168 James B 15,000
263 Andrew C 10,000
109 Bob C 10,000
Employee (2NF)
Project (2NF)
project_id project_name
113 blue star
124 magnum
Data Integrity
• Insert Anomaly - adding null values. eg, inserting a
new project does not require the primary key of emp_no
to be added.
• Update Anomaly - multiple updates for a single name
change, causes performance degradation. eg, changing
magnum project_name to meganum.
• Delete Anomaly - deleting wanted information. eg,
deleting the magnum project removes employee John
personal info from the database.
Third Normal Form (3NF)
Remove transitive dependencies.
•Transitive dependency – if an attribute can be
determined by another non-key attribute.
• Any transitive dependencies are moved into a
smaller (subset) table.
3NF further improves data integrity.
• Prevents update, insert, and delete anomalies.
Transitive Dependency
salary is determined by grade and not the key
attribute emp_no.
Thus this transitive dependency needs to be
removed, and grade and salary are moved to another
table.
emp_no emp_name grade salary
142 John A 20,000
168 James B 15,000
263 Andrew C 10,000
109 Bob C 10,000
Employee (3NF)
3NF
emp_no emp_name grade
142 John A
168 James B
263 Andrew C
109 Bob C
Employee (3NF) Project (3NF)
project_id project_name
113 blue star
124 magnum
Employee Project(3NF)
emp_no project_name
142 113
142 124
168 113
263 113
109 124
Grade Salary(3NF)
grade salary
A 20,000
B 15,000
C 10,000
Denormalization
 Denormalization is a technique to move from
higher to lower normal forms of database
modeling in order to speed up database
access.

More Related Content

PPTX
Sql 
statements , functions & joins
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Sql statements function join
baabtra.com - No. 1 supplier of quality freshers
 
PDF
SQL Queries - DML Commands
ShubhamBauddh
 
PDF
MERGE SQL Statement: Lesser Known Facets
Andrej Pashchenko
 
PDF
SQL Macros - Game Changing Feature for SQL Developers?
Andrej Pashchenko
 
PPTX
Sql statement,functions and joins
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Adbms 39 algorithms for project and set operations
Vaibhav Khanna
 
PPTX
Distributed Query Processing
Mythili Kannan
 
Sql 
statements , functions & joins
baabtra.com - No. 1 supplier of quality freshers
 
SQL Queries - DML Commands
ShubhamBauddh
 
MERGE SQL Statement: Lesser Known Facets
Andrej Pashchenko
 
SQL Macros - Game Changing Feature for SQL Developers?
Andrej Pashchenko
 
Sql statement,functions and joins
baabtra.com - No. 1 supplier of quality freshers
 
Adbms 39 algorithms for project and set operations
Vaibhav Khanna
 
Distributed Query Processing
Mythili Kannan
 

Viewers also liked (20)

PPTX
AlaSQL библиотека для обработки JavaScript данных (презентация для ForntEnd 2...
Andrey Gershun
 
PPT
Module06
Sridhar P
 
DOC
Css introduction
Sridhar P
 
PPT
Module08
Sridhar P
 
PPTX
Alasql.js - SQL сервер на JavaScript
Andrey Gershun
 
PPTX
Sql Server Data Tools - Codenamed JUNEAU
Lohith Goudagere Nagaraj
 
PPT
SQL Server 2008 for Developers
llangit
 
PDF
5 tsssisu sql_server_2012
Steve Xu
 
PPT
Module05
Sridhar P
 
PPT
Module03
Sridhar P
 
PDF
High Performance Front-End Development
drywallbmb
 
PPT
Module07
Sridhar P
 
PPT
Module01
Sridhar P
 
PDF
Multi-thematic spatial databases
Conor Mc Elhinney
 
PDF
Multidimensional model programming
Steve Xu
 
PPTX
Alasql - база данных SQL на JavaScript (MoscowJS)
Andrey Gershun
 
PPTX
SQL Server 2008 Spatial Data - Getting Started
Integrated Network Strategies
 
PDF
Transact sql data definition language - ddl- reference
Steve Xu
 
PDF
Spatialware_2_Sql08
Mike Osbourn
 
PDF
X query language reference
Steve Xu
 
AlaSQL библиотека для обработки JavaScript данных (презентация для ForntEnd 2...
Andrey Gershun
 
Module06
Sridhar P
 
Css introduction
Sridhar P
 
Module08
Sridhar P
 
Alasql.js - SQL сервер на JavaScript
Andrey Gershun
 
Sql Server Data Tools - Codenamed JUNEAU
Lohith Goudagere Nagaraj
 
SQL Server 2008 for Developers
llangit
 
5 tsssisu sql_server_2012
Steve Xu
 
Module05
Sridhar P
 
Module03
Sridhar P
 
High Performance Front-End Development
drywallbmb
 
Module07
Sridhar P
 
Module01
Sridhar P
 
Multi-thematic spatial databases
Conor Mc Elhinney
 
Multidimensional model programming
Steve Xu
 
Alasql - база данных SQL на JavaScript (MoscowJS)
Andrey Gershun
 
SQL Server 2008 Spatial Data - Getting Started
Integrated Network Strategies
 
Transact sql data definition language - ddl- reference
Steve Xu
 
Spatialware_2_Sql08
Mike Osbourn
 
X query language reference
Steve Xu
 
Ad

Similar to Sql server ___________session3-normailzation (20)

PDF
Normalization in Database
A. S. M. Shafi
 
PPTX
Database - Normalization
Mudasir Qazi
 
PPTX
Database Management System Normalization
mmvrm
 
DOCX
Database Normalization.docx
SHARMISTHAlearning
 
PDF
UNIT 4 NORMALIZATION AND QUERY OPTIMIZATION 9.pdf
saranyaksr92
 
PPTX
Chapter Four Logical Database Design (Normalization).pptx
haymanot taddesse
 
PPTX
Normalization_database_EERD_education,presentation.pptx
charlesharri01
 
PDF
Chapter – 4 Normalization and Relational Algebra.pdf
TamiratDejene1
 
PPT
Chapter six - Normalization.ppt fundamental of db
bereketalemayehu34
 
PDF
24042020_normalization 1.pdf
Shivani139202
 
PPTX
Week 6 Normalization
oudesign
 
PPTX
L1-Normalization 1NF 2NF 3NF 4NF BCNF.pptx
ChandrashekharSingh859453
 
PDF
Normalisation [Slides].pdf introduction language
AndrewSilungwe2
 
PDF
Ch06-Normalization SDHVFDDGNMFBVMBNCVMNMV
barsubiasarah
 
PPTX
Database Normalisation
sheetalverma38
 
PPT
Normalization_BCA_
Bhavini Shah
 
PPTX
normalization-1.pptx
AbhishekJohnCharan1
 
PPTX
normalisation jdsuhduswwhdusw cdscsacasc.pptx
angelinjeba6
 
DOCX
Normalization in relational database management systems
Preethi T G
 
PPTX
Normalization
Mohd Mastana
 
Normalization in Database
A. S. M. Shafi
 
Database - Normalization
Mudasir Qazi
 
Database Management System Normalization
mmvrm
 
Database Normalization.docx
SHARMISTHAlearning
 
UNIT 4 NORMALIZATION AND QUERY OPTIMIZATION 9.pdf
saranyaksr92
 
Chapter Four Logical Database Design (Normalization).pptx
haymanot taddesse
 
Normalization_database_EERD_education,presentation.pptx
charlesharri01
 
Chapter – 4 Normalization and Relational Algebra.pdf
TamiratDejene1
 
Chapter six - Normalization.ppt fundamental of db
bereketalemayehu34
 
24042020_normalization 1.pdf
Shivani139202
 
Week 6 Normalization
oudesign
 
L1-Normalization 1NF 2NF 3NF 4NF BCNF.pptx
ChandrashekharSingh859453
 
Normalisation [Slides].pdf introduction language
AndrewSilungwe2
 
Ch06-Normalization SDHVFDDGNMFBVMBNCVMNMV
barsubiasarah
 
Database Normalisation
sheetalverma38
 
Normalization_BCA_
Bhavini Shah
 
normalization-1.pptx
AbhishekJohnCharan1
 
normalisation jdsuhduswwhdusw cdscsacasc.pptx
angelinjeba6
 
Normalization in relational database management systems
Preethi T G
 
Normalization
Mohd Mastana
 
Ad

More from Ehtisham Ali (17)

PPT
Android tutorial
Ehtisham Ali
 
PPTX
Sql server ___________session_20(ddl triggers)
Ehtisham Ali
 
PPTX
Sql server ___________session2-data_modeling
Ehtisham Ali
 
PPTX
Sql server ___________session_19(triggers)
Ehtisham Ali
 
PPTX
Sql server ___________session_18(stored procedures)
Ehtisham Ali
 
PPTX
Sql server ___________session_17(indexes)
Ehtisham Ali
 
PPTX
Sql server ___________session_16(views)
Ehtisham Ali
 
PPTX
Sql server ___________session_15(data integrity)
Ehtisham Ali
 
PPTX
Sql server ___________session_11-12(joins)
Ehtisham Ali
 
PPTX
Sql server ___________session_10(group by clause)
Ehtisham Ali
 
PPT
Sql server ___________session_1-intro
Ehtisham Ali
 
PPT
Sql server ___________session 3(sql 2008)
Ehtisham Ali
 
PPT
Sql server ___________session 2(sql 2008)
Ehtisham Ali
 
PPT
Sql server ___________session 1(sql 2008)
Ehtisham Ali
 
PPTX
Sql server ___________data type of sql server
Ehtisham Ali
 
PPTX
Sql server ___________data control language
Ehtisham Ali
 
PPTX
Sql server ___________ (advance sql)
Ehtisham Ali
 
Android tutorial
Ehtisham Ali
 
Sql server ___________session_20(ddl triggers)
Ehtisham Ali
 
Sql server ___________session2-data_modeling
Ehtisham Ali
 
Sql server ___________session_19(triggers)
Ehtisham Ali
 
Sql server ___________session_18(stored procedures)
Ehtisham Ali
 
Sql server ___________session_17(indexes)
Ehtisham Ali
 
Sql server ___________session_16(views)
Ehtisham Ali
 
Sql server ___________session_15(data integrity)
Ehtisham Ali
 
Sql server ___________session_11-12(joins)
Ehtisham Ali
 
Sql server ___________session_10(group by clause)
Ehtisham Ali
 
Sql server ___________session_1-intro
Ehtisham Ali
 
Sql server ___________session 3(sql 2008)
Ehtisham Ali
 
Sql server ___________session 2(sql 2008)
Ehtisham Ali
 
Sql server ___________session 1(sql 2008)
Ehtisham Ali
 
Sql server ___________data type of sql server
Ehtisham Ali
 
Sql server ___________data control language
Ehtisham Ali
 
Sql server ___________ (advance sql)
Ehtisham Ali
 

Recently uploaded (20)

PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
DOCX
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PDF
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
Basics and rules of probability with real-life uses
ravatkaran694
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 

Sql server ___________session3-normailzation

  • 2. Normalization  Normalization is the process of efficiently organizing data in a database.  Normalization is the process of applying a series of rules to ensure that your database achieves optimal structure.
  • 3. Why we do Normalization?  There are two goals of the normalization process: 1- eliminating redundant data For example: storing the same data in more than one table 2- ensuring data dependencies make sense. For example: only storing related data in a table. Both of these are worthy goals as they reduce the amount of space a database consumes and ensure that data is logically stored.
  • 4. Database Anomalies:  Repetition Anomaly  Insertion Anomaly  Deletion Anomaly  Updating Anomaly
  • 5. First Normal Form (1NF)  Each attribute must be atomic • No repeating columns within a row. • No multi-valued columns.  1NF simplifies attributes • Queries become easier.
  • 6. 1NF Employee (unnormalized) emp_no emp_name project_id project_name grade salary 142 John 113, 124 blue star, magnum A 20,000 168 James 113 blue star B 15,000 263 Andrew 113 blue star C 10,000 Employee (1NF) emp_no emp_name project_id project_name grade salary 142 John 113 blue star A 20,000 142 John 124 magnum A 20,000 168 James 113 blue star B 15,000 263 Andrew 113 blue star C 10,000
  • 7. Second Normal Form (2NF)  Each attribute must be functionally dependent on the primary key. • Partial Functional dependency – a non-key attribute should not be partially(functionally) dependent on more than one key attribute. • Any non-dependent attributes are moved into a smaller (subset) table.  2NF improves data integrity. • Prevents update, insert, and delete anomalies.
  • 8. Functional Dependency Emp_name, grade and salary are functionally dependent only on emp_no. (emp_no -> emp_name, grade, salary) Project_name is dependent only on project_id. But these table should be related through foreign keys. emp_no emp_name grade salary 142 John A 20,000 168 James B 15,000 263 Andrew C 10,000 109 Bob C 10,000 Employee (1NF) Project (1NF) project_id project_name 113 blue star 124 magnum
  • 9. 2NF emp_no emp_name grade salary 142 John A 20,000 168 James B 15,000 263 Andrew C 10,000 109 Bob C 10,000 Employee (2NF) Project (2NF) project_id project_name 113 blue star 124 magnum
  • 10. Data Integrity • Insert Anomaly - adding null values. eg, inserting a new project does not require the primary key of emp_no to be added. • Update Anomaly - multiple updates for a single name change, causes performance degradation. eg, changing magnum project_name to meganum. • Delete Anomaly - deleting wanted information. eg, deleting the magnum project removes employee John personal info from the database.
  • 11. Third Normal Form (3NF) Remove transitive dependencies. •Transitive dependency – if an attribute can be determined by another non-key attribute. • Any transitive dependencies are moved into a smaller (subset) table. 3NF further improves data integrity. • Prevents update, insert, and delete anomalies.
  • 12. Transitive Dependency salary is determined by grade and not the key attribute emp_no. Thus this transitive dependency needs to be removed, and grade and salary are moved to another table. emp_no emp_name grade salary 142 John A 20,000 168 James B 15,000 263 Andrew C 10,000 109 Bob C 10,000 Employee (3NF)
  • 13. 3NF emp_no emp_name grade 142 John A 168 James B 263 Andrew C 109 Bob C Employee (3NF) Project (3NF) project_id project_name 113 blue star 124 magnum Employee Project(3NF) emp_no project_name 142 113 142 124 168 113 263 113 109 124 Grade Salary(3NF) grade salary A 20,000 B 15,000 C 10,000
  • 14. Denormalization  Denormalization is a technique to move from higher to lower normal forms of database modeling in order to speed up database access.

Editor's Notes

  • #13: Note, dept_name is functionally dependent on dept_no. Dept_no is functionally dependent on emp_no, so via the middle step of dept_no, dept_name is functionally dependent on emp_no. (emp_no -> dept_no , dept_no -> dept_name, thus emp_no -> dept_name)