SlideShare uma empresa Scribd logo
1 de 39
Chapter 4
Normalization of Database
Tables
Database Tables and
Normalization




Table is basic building block in database design
Table’s structure is of great interest
Two cases:





possible poor table structures in good database design
Modify existing database with existing poor table
structure

Normalization can help recognize a poor table and
convert to good tables with good structure
2
Database Tables and
Normalization


Normalization is process for assigning
attributes to entities
Reduces data redundancies
 Expending entities
 Helps eliminate data anomalies
 Produces controlled redundancies to link tables
 Cost more processing efforts
 Series steps called normal forms


3
Database Tables and
Normalization


Normalization stages
1NF - First normal form
 2NF - Second normal form
 3NF - Third normal form
 4NF - Fourth normal form


Better in
dependency

Business
Bioinformatics
Statistical data

Worse in
performance
(I/O)
4
Database Tables and
Normalization


Example: construction company


Building projects







Project number
Project name
Employees assigned
…

Employee




Employee number
Employee name
Job classification
5
Table 4.1 should be here.

6
Figure 4.1 Observations




PRO_NUM intended to be primary key, but
it contains null values.
Table entries invite data inconsistencies

7
Figure 4.1 Observations


Table displays data redundancies which yield
the following anomalies


Update




Insertion




Modifying JOB_CLASS
New employee must be assigned project (phantom
project)

Deletion


If employee deleted, other vital data lost

8
Figure 4.2 is insert here.

Repeating group (any project can have a group of
data entries) which should not to be appeared in
relational table
9
Data Organization: 1NF
PK

PK

Figure 4.3

10
Conversion to 1NF


Repeating groups must be eliminated


Proper primary key developed
Uniquely identifies attribute values (rows)
 Combination of PROJ_NUM and EMP_NUM


11
Conversion to 1NF


Repeating groups must be eliminated


Dependencies can be identified



A particular relationship between two attributes. For a given
relation, attribute B is functionally dependent on attribute A
if, for every valid value of A, that value of A uniquely
determines the value of B.



A functional dependency exists when the value of one thing
is fully determined by another. For example, given the
relation EMP(empNo, empName, sal), attribute empName
is functionally dependant on attribute empNo. If we know
empNo, we also know the empName.
12
Desirable dependencies based on primary key
Less desirable dependencies
Partial
based on part of composite primary key
Transitive
one nonprime attribute depends on
another nonprime attribute
13
Dependency Diagram (1NF)
Above: Desired Dependencies

Figure 4.4

Composite primary key
Below: Less Desired Dependencies

14
PROJ_NUM,EMP_NUM  PROJ_NAME, EMP_NAME,
JOB_CLASS,CHG_HOUR, HOURS

DESIRED DEPENDENCIES

PROJ_NUM  PROJ_NAME

PARTIAL DEPENDENCIES

EMP_NUM  EMP_NAME, JOB_CLASS, CHG_HOUR

JOB_CLASS -> CHG_HOUR

TRANSITIVE DEPENDENCIES

15
1NF Summarized




All key attributes defined
No repeating groups in table
All attributes dependent on
primary key

16
Conversion to 2NF






Start with 1NF format:
Write each key component on separate line
Write original key on last line
Each component is new table
Write dependent attributes after each key

PROJECT (PROJ_NUM, PROJ_NAME)
EMPLOYEE (EMP_NUM, EMP_NAME, JOB_CLASS, CHG_HOUR)
ASSIGN (PROJ_NUM, EMP_NUM, HOURS)
17
2NF Conversion Results
Figure 4.5

18
2NF Summarized



In 1NF
Includes no partial dependencies




No attribute dependent on a portion of primary
key

Still possible to exhibit transitive dependency


Attributes may be functionally dependent on
nonkey attributes

19
Conversion to 3NF


Create separate table(s) to eliminate transitive
functional dependencies

PROJECT (PROJ_NUM, PROJ_NAME)
ASSIGN (PROJ_NUM, EMP_NUM, HOURS)
EMPLOYEE (EMP_NUM, EMP_NAME, JOB_CLASS)
JOB (JOB_CLASS, CHG_HOUR)

20
3NF Summarized



In 2NF
Contains no transitive
dependencies

21
Additional DB Enhancements

Figure 4.6

22
23
Boyce-Codd Normal Form
(BCNF)


Every determinant in the table is a candidate
key
Determinant is attribute whose value determines
other values in row
 3NF table with one candidate key is already in
BCNF


24
3NF Table Not in BCNF

Figure 4.7

25
Decomposition of Table
Structure to Meet BCNF

Figure 4.8
26
Example: BCNF conversion

27
Decomposition into BCNF

Figure 4.9
28
Normalization and Database
Design








Normalization should be part of the design
process
Make sure the proposed entities meet the
required normal form before the table
structures are created
Used to redesign or modify the existing table
structures.
E-R Diagram provides macro view
29
Normalization and Database
Design


Normalization provides micro view of
entities
Focuses on characteristics of specific entities
 May yield additional entities






Difficult to separate normalization from E-R
diagramming
Business rules must be determined
30
Normalization and Database
Design


Contracting company’s example:

PROJECT (PROJ_NUM, PROJ_NAME)
EMPLOYEE(EMP_NUM, EMP_LNAME,EMP_FNAME,EMP_INITAL,
JOB_DESCRIPTION, JOB_CHG_HOUR);

31
Initial ERD for Contracting
Company

Figure 4.10
There is a transitive dependency

Already 3NF
32
Removal
PROJECT (PROJ_NUM, PROJ_NAME)
EMPLOYEE(EMP_NUM, EMP_LNAME,EMP_FNAME,EMP_INITAL,
JOB_CODE)
JOB (JOB_CODE, JOB_DESCRIPTION, JOB_CHG_HOUR);

33
Modified ERD for
Contracting Company

Figure 4.11

34
Final ERD for
Contracting Company

Figure 4.12
(M:N) converting to (1:M)

35
PROJECT (PROJ_NUM, PROJ_NAME, EMP_NUM)
EMPLOYEE(EMP_NUM, EMP_LNAME,EMP_FNAME,EMP_INITAL,
EMP_HIREDATE, JOB_CODE)
JOB (JOB_CODE,, JOB_DESCRIPTION, JOB_CHG_HOUR);
ASSIGN((ASSIGN_NUM, ASSIGN_DATE, ASSIGN_HOURS,
ASSIGN_CHG_HOURS, ASSIGN_CHARGE, EMP_NUM, PROJ_JUM)

36
37
Denormalization




Normalization is one of many database
design goals
Normalized table requirements
Additional processing
 Loss of system speed


38
Denormalization


Normalization purity is difficult to sustain
due to conflict in:
Design efficiency
 Information requirements
 Processing


39

Mais conteúdo relacionado

Mais procurados

Logical database design and the relational model(database)
Logical database design and the relational model(database)Logical database design and the relational model(database)
Logical database design and the relational model(database)
welcometofacebook
 

Mais procurados (20)

Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Ism normalization pine valley 2012
Ism normalization pine valley 2012Ism normalization pine valley 2012
Ism normalization pine valley 2012
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
 
Logical database design and the relational model(database)
Logical database design and the relational model(database)Logical database design and the relational model(database)
Logical database design and the relational model(database)
 
Dbms normalization
Dbms normalizationDbms normalization
Dbms normalization
 
Normalization of Data Base
Normalization of Data BaseNormalization of Data Base
Normalization of Data Base
 
Er to tables
Er to tablesEr to tables
Er to tables
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
 
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 in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Enhanced ER(database)
Enhanced ER(database)Enhanced ER(database)
Enhanced ER(database)
 
Dbms4
Dbms4Dbms4
Dbms4
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
database Normalization
database Normalizationdatabase Normalization
database Normalization
 
Normalization
NormalizationNormalization
Normalization
 
DBMS PPT
DBMS PPTDBMS PPT
DBMS PPT
 
Normalization in databases
Normalization in databasesNormalization in databases
Normalization in databases
 
Normalisation
NormalisationNormalisation
Normalisation
 
Dbms Useful PPT
Dbms Useful PPTDbms Useful PPT
Dbms Useful PPT
 
Dbms 4NF & 5NF
Dbms 4NF & 5NFDbms 4NF & 5NF
Dbms 4NF & 5NF
 

Destaque

b - Normalizing a Data Model
b - Normalizing a Data Modelb - Normalizing a Data Model
b - Normalizing a Data Model
Dimara Hakim
 
Database Introduction - Join Query
Database Introduction - Join QueryDatabase Introduction - Join Query
Database Introduction - Join Query
Dudy Ali
 

Destaque (20)

Normalization of database tables
Normalization of database tablesNormalization of database tables
Normalization of database tables
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Database - Normalization
Database - NormalizationDatabase - Normalization
Database - Normalization
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Waste Data and LDF Preparation - Trevor Brown
Waste Data and LDF Preparation - Trevor BrownWaste Data and LDF Preparation - Trevor Brown
Waste Data and LDF Preparation - Trevor Brown
 
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
 
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
 
b - Normalizing a Data Model
b - Normalizing a Data Modelb - Normalizing a Data Model
b - Normalizing a Data Model
 
Database Introduction - Join Query
Database Introduction - Join QueryDatabase Introduction - Join Query
Database Introduction - Join Query
 
Scrum Model
Scrum ModelScrum Model
Scrum Model
 
Dbms ii mca-ch8-db design-2013
Dbms ii mca-ch8-db design-2013Dbms ii mca-ch8-db design-2013
Dbms ii mca-ch8-db design-2013
 
Dbms ii mca-ch7-sql-2013
Dbms ii mca-ch7-sql-2013Dbms ii mca-ch7-sql-2013
Dbms ii mca-ch7-sql-2013
 
Dbms ii mca-ch10-concurrency-control-2013
Dbms ii mca-ch10-concurrency-control-2013Dbms ii mca-ch10-concurrency-control-2013
Dbms ii mca-ch10-concurrency-control-2013
 
SQL Join Basic
SQL Join BasicSQL Join Basic
SQL Join Basic
 
Joins in databases
Joins in databases Joins in databases
Joins in databases
 
Everything about Database JOINS and Relationships
Everything about Database JOINS and RelationshipsEverything about Database JOINS and Relationships
Everything about Database JOINS and Relationships
 
SQL
SQLSQL
SQL
 

Semelhante a Normalization of database_tables_chapter_4

Penormalan/Normalization
Penormalan/NormalizationPenormalan/Normalization
Penormalan/Normalization
Joan Ador
 
Database normalization
Database normalizationDatabase normalization
Database normalization
Jignesh Jain
 
Advanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docxAdvanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docx
nettletondevon
 
Database DESIGN CONCEPTSDr. Dexter Francis2Data Design
Database DESIGN CONCEPTSDr. Dexter Francis2Data DesignDatabase DESIGN CONCEPTSDr. Dexter Francis2Data Design
Database DESIGN CONCEPTSDr. Dexter Francis2Data Design
OllieShoresna
 
Dependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its typesDependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its types
nsrChowdary1
 
Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databases
Jafar Nesargi
 
What is Database NormalizationExplain the guidelines for ensuring t.pdf
What is Database NormalizationExplain the guidelines for ensuring t.pdfWhat is Database NormalizationExplain the guidelines for ensuring t.pdf
What is Database NormalizationExplain the guidelines for ensuring t.pdf
arjunstores123
 
Normalization work as through a series of stages called normal forms .pdf
Normalization work as through a series of stages called normal forms .pdfNormalization work as through a series of stages called normal forms .pdf
Normalization work as through a series of stages called normal forms .pdf
deepaarora22
 

Semelhante a Normalization of database_tables_chapter_4 (20)

Chapter Four Logical Database Design (Normalization).pptx
Chapter Four Logical Database Design (Normalization).pptxChapter Four Logical Database Design (Normalization).pptx
Chapter Four Logical Database Design (Normalization).pptx
 
Chapter 3 ( PART 2 ).pptx
Chapter 3 ( PART 2 ).pptxChapter 3 ( PART 2 ).pptx
Chapter 3 ( PART 2 ).pptx
 
Normalization
NormalizationNormalization
Normalization
 
Lecture8 Normalization Aggarwal
Lecture8 Normalization AggarwalLecture8 Normalization Aggarwal
Lecture8 Normalization Aggarwal
 
Penormalan/Normalization
Penormalan/NormalizationPenormalan/Normalization
Penormalan/Normalization
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Presentation on Normalization.pptx
Presentation on Normalization.pptxPresentation on Normalization.pptx
Presentation on Normalization.pptx
 
Advanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docxAdvanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docx
 
Database DESIGN CONCEPTSDr. Dexter Francis2Data Design
Database DESIGN CONCEPTSDr. Dexter Francis2Data DesignDatabase DESIGN CONCEPTSDr. Dexter Francis2Data Design
Database DESIGN CONCEPTSDr. Dexter Francis2Data Design
 
04 quiz 1 answer key
04 quiz 1 answer key04 quiz 1 answer key
04 quiz 1 answer key
 
Relational Algebra.ppt
Relational Algebra.pptRelational Algebra.ppt
Relational Algebra.ppt
 
Database Normalization.docx
Database Normalization.docxDatabase Normalization.docx
Database Normalization.docx
 
Dependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its typesDependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its types
 
21792 relational database managementsystem
21792 relational database managementsystem21792 relational database managementsystem
21792 relational database managementsystem
 
Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databases
 
Normalization in Database Management System.pptx
Normalization in Database Management System.pptxNormalization in Database Management System.pptx
Normalization in Database Management System.pptx
 
Rdbms
RdbmsRdbms
Rdbms
 
What is Database NormalizationExplain the guidelines for ensuring t.pdf
What is Database NormalizationExplain the guidelines for ensuring t.pdfWhat is Database NormalizationExplain the guidelines for ensuring t.pdf
What is Database NormalizationExplain the guidelines for ensuring t.pdf
 
Normalization work as through a series of stages called normal forms .pdf
Normalization work as through a series of stages called normal forms .pdfNormalization work as through a series of stages called normal forms .pdf
Normalization work as through a series of stages called normal forms .pdf
 
Normalizatrion.ppt
Normalizatrion.pptNormalizatrion.ppt
Normalizatrion.ppt
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Último (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 

Normalization of database_tables_chapter_4