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
PPTX
PDF
SQL Queries - DML Commands
PDF
MERGE SQL Statement: Lesser Known Facets
PDF
SQL Macros - Game Changing Feature for SQL Developers?
PPTX
Sql statement,functions and joins
PPTX
Adbms 39 algorithms for project and set operations
PPTX
Distributed Query Processing
Sql 
statements , functions & joins
SQL Queries - DML Commands
MERGE SQL Statement: Lesser Known Facets
SQL Macros - Game Changing Feature for SQL Developers?
Sql statement,functions and joins
Adbms 39 algorithms for project and set operations
Distributed Query Processing

Viewers also liked (20)

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

Similar to Sql server ___________session3-normailzation (20)

PPT
Normalisation revision
PPT
SQL WORKSHOP::Lecture 9
PPT
Normalization_BCA_
PPTX
2 normalization
PPT
Normalization.ppt
PPTX
Kumar lav
PDF
Normalization in Database
PPTX
Oracle JSON internals advanced edition
PPTX
Database - Normalization
PPT
Normalization case
PPT
database administration level 3 _lecture5.ppt
PPTX
Chapter 6 database normalisation
PPT
Les09[1]Manipulating Data
PPTX
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
DOCX
Database Normalization.docx
DOC
Dbmsmanual
PDF
3 d db-exercise-workshop
PDF
4.Database Management System.pdf
PDF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalisation revision
SQL WORKSHOP::Lecture 9
Normalization_BCA_
2 normalization
Normalization.ppt
Kumar lav
Normalization in Database
Oracle JSON internals advanced edition
Database - Normalization
Normalization case
database administration level 3 _lecture5.ppt
Chapter 6 database normalisation
Les09[1]Manipulating Data
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
Database Normalization.docx
Dbmsmanual
3 d db-exercise-workshop
4.Database Management System.pdf
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Ad

More from Ehtisham Ali (17)

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

Recently uploaded (20)

PDF
RMMM.pdf make it easy to upload and study
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Complications of Minimal Access Surgery at WLH
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Classroom Observation Tools for Teachers
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Basic Mud Logging Guide for educational purpose
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
PPH.pptx obstetrics and gynecology in nursing
RMMM.pdf make it easy to upload and study
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Complications of Minimal Access Surgery at WLH
Module 4: Burden of Disease Tutorial Slides S2 2025
Renaissance Architecture: A Journey from Faith to Humanism
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Classroom Observation Tools for Teachers
Abdominal Access Techniques with Prof. Dr. R K Mishra
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Basic Mud Logging Guide for educational purpose
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Final Presentation General Medicine 03-08-2024.pptx
TR - Agricultural Crops Production NC III.pdf
Anesthesia in Laparoscopic Surgery in India
PPH.pptx obstetrics and gynecology in nursing

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)