SlideShare una empresa de Scribd logo
1 de 30
 Functional dependencies play a key role in
differentiating good database designs from database
design. A functional dependency is a type of constraint
that is a generalization of the notion a key
Functional dependencies
Different definitions to define FD
 FD's are constraints on well-formed relations and represent a formalism
on the infrastructure of relation.
Definition: A functional dependency (FD) on a relation schema R is
a constraint X → Y, where X and Y are subsets of attributes of R.
Definition: an FD is a relationship between an attribute "Y" and a
determinant (1 or more other attributes) "X" such that for a given value
of a determinant the value of the attribute is uniquely defined.
i. X is a determinant
ii. X determines Y
iii. Y is functionally dependent on X
iv. X → Y
v. X →Y is trivial if Y Í X
 Definition: An FD X → Y is satisfied in an
instance r of R if for every pair of tuples, t and s:
if t and s agree on all attributes in X then they must
agree on all attributes in Y
A key constraint is a special kind of functional
dependency: all attributes of relation occur on the
right-hand side of the
 The determination of functional dependencies is an
important part of designing databases in the relational
model, and in database normalization and
de normalization.
 The functional dependencies, along with the attribute
domains, are selected so as to generate constraints that
would exclude as much data inappropriate to the user
domain from the system as possible.
 Functional depending set S is irreducible if the set has
three following properties:
 Each right set of a functional dependency of S contains only
one attribute.
 Each left set of a functional dependency of S is irreducible.
It means that reducing any one attribute from left set will
change the content of S (S will lose some information).
 Reducing any functional dependency will change the
content of S.
Properties of functional
dependencies
 The most important properties are Armstrong's
axioms, which are used in database normalization:
 Subset Property (Axiom of Reflexivity):
 If Y is a subset of X, then X → Y
 Augmentation (Axiom of Augmentation):
 If X → Y, then XZ → YZ
 Transitivity (Axiom of Transitivity):
 If X → Y and Y → Z, then X → Z
 From these rules, we can derive these secondary rules:
 Union:
 If X → Y and X → Z, then X → YZ
 Decomposition:
 If X → YZ, then X → Y and X → Z
 Pseudotransitivity:
 f X → Y and WY → Z, then XW → Z
Closure of set of FD
The closure is basically the full set of values that can be
determined from a set of known values for a given
relationship using its functional dependencies. You
use Armstrong's axioms to provide a proof - i.e.
Reflexivity, Augmentation, Transitivity.
Given R and F a set of FD’s that holds in R: The closure
of F in R (denoted F+) is the set of all FD’s in that are
logically implied by F
Closure of Attribute Set
 Given a set  of attributes of R and a set of functional dependencies F,
we need a way to find all of the attributes of R that are functionally
determined by . This set of attributes is called the closure of  under
F and is denoted +. Finding + is useful because:
 if + = R, then  is a superkey for R
 if we find + for all  R, we've computed F+ (except that we'd need to
use decomposition to get all of it).
 An algorithm for computing +:
result :=  repeat
temp := result
for each functional dependency    in F do
if   result then
result := result  
until temp = result
Canonical cover
Algorithm for computing a
canonical cover
Normalization
 Normalization is a systematic way of ensuring that
a database structure is suitable for general-purpose
querying and free of certain undesirable
characteristics—insertion, update, and deletion
anomalies—that could lead to a loss of data
integrity
Normal forms
 The normal forms (abbrev. NF) of relational database
theory provide criteria for determining a table's degree
of vulnerability to logical inconsistencies and
anomalies.
 The normal forms are applicable to individual tables;
to say that an entire database is in normal form n is to
say that all of its tables are in normal form n.
Types of NF
 First Normal Form (1NF)
 Second Normal Form (2NF)
 Third Normal Form (3NF)
 Boyce-Codd Normal Form (BCNF)
 Fourth Normal Form (4NF)
 Fifth Normal Form (5NF) etc...
First Normal Form (1NF)
 A table is in 1NF if and only if it is "isomorphic to some
relation", which means, specifically, that it satisfies the
following five conditions:
 There's no top-to-bottom ordering to the rows.
 There's no left-to-right ordering to the columns.
 There are no duplicate rows.
 Every row-and-column intersection contains exactly one
value from the applicable domain (and nothing else).
 All columns are regular [i.e. rows have no hidden components
such as row IDs, object IDs, or hidden timestamps].
 Violation of any of these conditions would mean that the
table is not strictly relational, and therefore that it is not in
1NF.
Second Normal Form (2NF)
 Consider atable that is in first normal form (1NF) must
meet additional criteria if it is to qualify for second normal
form.
 Specifically: a 1NF table is in 2NF if and only if, given any
candidate key K and any attribute A that is not a
constituent of a candidate key, A depends upon the whole
of K rather than just a part of it.
 In slightly more formal terms: a 1NF table is in 2NF if and
only if all its non-prime attributes are functionally
dependent on the whole of a candidate key. (A non-prime
attribute is one that does not belong to any candidate key.)
 Consider a table describing employees' skills:
Employees' Skills
Employee Skill Current Work
Location
Jones Typing 114 Main Street
Jones Shorthand 114 Main Street
Jones Whittling 114 Main Street
Bravo Light Cleaning 73 Industrial Way
Ellis Alchemy 73 Industrial Way
Ellis Flying 73 Industrial Way
Harrison Light Cleaning 73 Industrial Way
 Neither {Employee} nor {Skill} is a candidate key for the
table.
 This is because a given Employee might need to appear
more than once (he might have multiple Skills), and a given
Skill might need to appear more than once (it might be
possessed by multiple Employees).
 Only the composite key {Employee, Skill} qualifies as a
candidate key for the table.
 The remaining attribute, Current Work Location, is
dependent on only part of the candidate key, namely
Employee.
 Therefore the table is not in 2NF.
 A 2NF alternative to this design would represent the
same information in two tables: an "Employees" table
with candidate key {Employee}, and an "Employees'
Skills" table with candidate key {Employee, Skill}:
Employees
Employee Current Work Location
Jones 114 Main Street
Bravo 73 Industrial Way
Ellis 73 Industrial Way
Harrison 73 Industrial Way
Employees' Skills
Employee Skill
Jones Typing
Jones Shorthand
Jones Whittling
Bravo Light Cleaning
Ellis Alchemy
Ellis Flying
Harrison Light Cleaning
Third Normal Form(3NF)
 The third normal form (3NF) is a normal form used
in database normalization.
 3NF was originally defined by E.F. Codd in 1971.
 Codd's definition states that a table is in 3NF if and
only if both of the following conditions hold:
 The relation R (table) is in second normal form (2NF)
 Every non-prime attribute of R is non-transitively
dependent (i.e. directly dependent) on every candidate
key of R.
 Basics of 3NF:
 A non-prime attribute of R is an attribute that does
not belong to any candidate key of R.
 A transitive dependency is a functional dependency in
which X → Z (X determines Z) indirectly, by virtue of
X → Y and Y → Z (where it is not the case that Y → X).
OR
In other words
 A table is in the third normal form if it is the
second normal form and there are no non-key
columns dependant on other non-key columns that
could not act as the primary key.
 Example
An example of a 2NF table that fails to meet the requirements of 3NF
is:
Tournament Winners
Tournament Year Winner Winner Date of
Birth
Indiana Invitational 1998 Al Fredrickson 21 July 1975
Cleveland Open 1999 Bob Albertson 28 September 1968
Des Moines Masters 1999 Al Fredrickson 21 July 1975
Indiana Invitational 1999 Chip Masterson 14 March 1977
 Because each row in the table needs to tell us who won
a particular Tournament in a particular Year, the
composite key {Tournament, Year} is a minimal set of
attributes guaranteed to uniquely identify a row.
 That is, {Tournament, Year} is a candidate key for the
table.
Tournament Winners
Tournament Year Winner
Indiana Invitational 1998 Al Fredrickson
Cleveland Open 1999 Bob Albertson
Des Moines Masters 1999 Al Fredrickson
Indiana Invitational 1999 Chip
Masterson
Player Dates of Birth
Player Date of Birth
Chip Masterson 14 March 1977
Al Fredrickson 21 July 1975
Bob Albertson 28 September 1968
In order to express the same facts without violating
3NF, it is necessary to split the table into two:
Boyce-Codd Normal Form (BCNF)
 Boyce-Codd normal form (or BCNF or 3.5NF) is a normal
form used in database normalization.
 It is a slightly stronger version of the third normal form (3NF).
 A table is in Boyce-Codd normal form if and only if for every
one of its non-trivial [dependencies] X → Y, X is a super key—
that is, X is either a candidate key or a superset thereof.
 BCNF was developed in 1974 by Raymond F. Boyce and Edgar
F. Codd to address certain types of anomaly not dealt with by
3NF as originally defined.
 Only in rare cases does a 3NF table not meet the requirements
of BCNF.
 Depending on what its functional dependencies are, a 3NF
table with two or more overlapping candidate keys may or may
not be in BCNF.
Main Difference Between BCNF
And 3NF
Most relations in 3NF are also in BCNF,
the only time this may not be true is
when there is more than one candidate
key for a relation and at least one of is
composite in 3NF.
Fourth Normal Form(4NF)
 Fourth normal form (or 4NF) requires that
there be no non-trivial multivalve dependencies
of attribute sets on something other than a
superset of a candidate key. A table is said to be
in 4NF if and only if it is in the BCNF and
multivalued dependencies are functional
dependencies. The 4NF removes unwanted
data structures: multivalued dependencies.
Fifth Normal Form(5NF)
 Fifth normal form (5NF and also PJ/NF)
requires that there are no non-trivial join
dependencies that do not follow from the key
constraints. A table is said to be in the 5NF if
and only if it is in 4NF and every join
dependency in it is implied by the candidate
keys.

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancy
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Joins And Its Types
Joins And Its TypesJoins And Its Types
Joins And Its Types
 
Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management System
 
Normalization
NormalizationNormalization
Normalization
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
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
 
Fifth normal form
Fifth normal formFifth normal form
Fifth normal form
 
Relational model
Relational modelRelational model
Relational model
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
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
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 
Bcnf
BcnfBcnf
Bcnf
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 

Destacado

functional dependencies with example
functional dependencies with examplefunctional dependencies with example
functional dependencies with exampleSiddhi Viradiya
 
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 databasesJafar Nesargi
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in DatabaseRoshni Singh
 
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
 
Shashi DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi  DATABASE FUNCTIONAL DEPENDENCY QUESTIONShashi  DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi DATABASE FUNCTIONAL DEPENDENCY QUESTIONShashi Kumar
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational databaseJyoti Ranjan Pattnaik
 
Multivalued dependency
Multivalued dependencyMultivalued dependency
Multivalued dependencyavniS
 
DBMS - FIRST NORMAL FORM
DBMS - FIRST NORMAL FORMDBMS - FIRST NORMAL FORM
DBMS - FIRST NORMAL FORMMANISH T I
 
Database Dependency with NetVisn
Database Dependency with NetVisnDatabase Dependency with NetVisn
Database Dependency with NetVisnEnvisn
 
Loss Less Routing(LCR)-Class 4 Softswitch
Loss Less Routing(LCR)-Class 4 Softswitch Loss Less Routing(LCR)-Class 4 Softswitch
Loss Less Routing(LCR)-Class 4 Softswitch REVE Systems
 
DBMS Lecture 8 - Normalization
DBMS Lecture 8 - NormalizationDBMS Lecture 8 - Normalization
DBMS Lecture 8 - NormalizationEricka Tagarda
 
Normalization form tutorial
Normalization form tutorialNormalization form tutorial
Normalization form tutorialNikhildas P C
 

Destacado (19)

Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
functional dependencies with example
functional dependencies with examplefunctional dependencies with example
functional dependencies with example
 
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
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Shashi DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi  DATABASE FUNCTIONAL DEPENDENCY QUESTIONShashi  DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi DATABASE FUNCTIONAL DEPENDENCY QUESTION
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational database
 
DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
 
Multivalued dependency
Multivalued dependencyMultivalued dependency
Multivalued dependency
 
Normlaization
NormlaizationNormlaization
Normlaization
 
Normalization
NormalizationNormalization
Normalization
 
DBMS - FIRST NORMAL FORM
DBMS - FIRST NORMAL FORMDBMS - FIRST NORMAL FORM
DBMS - FIRST NORMAL FORM
 
Normalisation revision
Normalisation revisionNormalisation revision
Normalisation revision
 
Database Dependency with NetVisn
Database Dependency with NetVisnDatabase Dependency with NetVisn
Database Dependency with NetVisn
 
Dbms unit-3
Dbms unit-3Dbms unit-3
Dbms unit-3
 
Loss Less Routing(LCR)-Class 4 Softswitch
Loss Less Routing(LCR)-Class 4 Softswitch Loss Less Routing(LCR)-Class 4 Softswitch
Loss Less Routing(LCR)-Class 4 Softswitch
 
DBMS Lecture 8 - Normalization
DBMS Lecture 8 - NormalizationDBMS Lecture 8 - Normalization
DBMS Lecture 8 - Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Normalization form tutorial
Normalization form tutorialNormalization form tutorial
Normalization form tutorial
 

Similar a Functional dependencies and normalization

a - Normalizing a Data Model
a - Normalizing a Data Modela - Normalizing a Data Model
a - Normalizing a Data ModelDimara Hakim
 
functional dependency in engineering.pptx
functional dependency in engineering.pptxfunctional dependency in engineering.pptx
functional dependency in engineering.pptxamanchouhan9917
 
Normalization basde dON SHDIEHGFJSGDFGI
Normalization basde dON  SHDIEHGFJSGDFGINormalization basde dON  SHDIEHGFJSGDFGI
Normalization basde dON SHDIEHGFJSGDFGIarindamdas591494
 
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NFALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NFijdms
 
7 relational database design algorithms and further dependencies
7 relational database design algorithms and further dependencies7 relational database design algorithms and further dependencies
7 relational database design algorithms and further dependenciesKumar
 
Normalizacion de una base de dat
Normalizacion de una base de datNormalizacion de una base de dat
Normalizacion de una base de datYerson Correa
 
Ism normalization pine valley 2012
Ism normalization pine valley 2012Ism normalization pine valley 2012
Ism normalization pine valley 2012Akshit R Shah
 
Data base management system (2)
Data base management system (2)Data base management system (2)
Data base management system (2)MrinalDev1
 
Normalization
NormalizationNormalization
Normalizationmomo2187
 
Functional dependenciesAn FD X-Y is satisfied in an instance r of .pdf
Functional dependenciesAn FD X-Y is satisfied in an instance r of .pdfFunctional dependenciesAn FD X-Y is satisfied in an instance r of .pdf
Functional dependenciesAn FD X-Y is satisfied in an instance r of .pdfpritikulkarni20
 

Similar a Functional dependencies and normalization (20)

Function Dependencies and Normalization
 Function Dependencies and Normalization Function Dependencies and Normalization
Function Dependencies and Normalization
 
Types of normalization
Types of normalizationTypes of normalization
Types of normalization
 
a - Normalizing a Data Model
a - Normalizing a Data Modela - Normalizing a Data Model
a - Normalizing a Data Model
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
functional dependency in engineering.pptx
functional dependency in engineering.pptxfunctional dependency in engineering.pptx
functional dependency in engineering.pptx
 
Unit05 dbms
Unit05 dbmsUnit05 dbms
Unit05 dbms
 
Normalization1
Normalization1Normalization1
Normalization1
 
Normalization basde dON SHDIEHGFJSGDFGI
Normalization basde dON  SHDIEHGFJSGDFGINormalization basde dON  SHDIEHGFJSGDFGI
Normalization basde dON SHDIEHGFJSGDFGI
 
Normalization
NormalizationNormalization
Normalization
 
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NFALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
 
Chapter10
Chapter10Chapter10
Chapter10
 
Normalization
NormalizationNormalization
Normalization
 
Unit 3 dbms
Unit 3 dbmsUnit 3 dbms
Unit 3 dbms
 
7 relational database design algorithms and further dependencies
7 relational database design algorithms and further dependencies7 relational database design algorithms and further dependencies
7 relational database design algorithms and further dependencies
 
Normalizacion de una base de dat
Normalizacion de una base de datNormalizacion de una base de dat
Normalizacion de una base de dat
 
Normalization
NormalizationNormalization
Normalization
 
Ism normalization pine valley 2012
Ism normalization pine valley 2012Ism normalization pine valley 2012
Ism normalization pine valley 2012
 
Data base management system (2)
Data base management system (2)Data base management system (2)
Data base management system (2)
 
Normalization
NormalizationNormalization
Normalization
 
Functional dependenciesAn FD X-Y is satisfied in an instance r of .pdf
Functional dependenciesAn FD X-Y is satisfied in an instance r of .pdfFunctional dependenciesAn FD X-Y is satisfied in an instance r of .pdf
Functional dependenciesAn FD X-Y is satisfied in an instance r of .pdf
 

Más de daxesh chauhan

Rsa and diffie hellman algorithms
Rsa and diffie hellman algorithmsRsa and diffie hellman algorithms
Rsa and diffie hellman algorithmsdaxesh chauhan
 
Elastic beam (bending of beam model)
Elastic beam (bending of beam model)Elastic beam (bending of beam model)
Elastic beam (bending of beam model)daxesh chauhan
 
Insertionsort shellsort heapsort
Insertionsort shellsort heapsortInsertionsort shellsort heapsort
Insertionsort shellsort heapsortdaxesh chauhan
 
COMBINATIONAL PLD-BASED STATE MACHINES
COMBINATIONAL PLD-BASED STATE MACHINESCOMBINATIONAL PLD-BASED STATE MACHINES
COMBINATIONAL PLD-BASED STATE MACHINESdaxesh chauhan
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop pptdaxesh chauhan
 
Input - output organzation
Input - output organzationInput - output organzation
Input - output organzationdaxesh chauhan
 

Más de daxesh chauhan (7)

Rsa and diffie hellman algorithms
Rsa and diffie hellman algorithmsRsa and diffie hellman algorithms
Rsa and diffie hellman algorithms
 
Elastic beam (bending of beam model)
Elastic beam (bending of beam model)Elastic beam (bending of beam model)
Elastic beam (bending of beam model)
 
Insertionsort shellsort heapsort
Insertionsort shellsort heapsortInsertionsort shellsort heapsort
Insertionsort shellsort heapsort
 
COMBINATIONAL PLD-BASED STATE MACHINES
COMBINATIONAL PLD-BASED STATE MACHINESCOMBINATIONAL PLD-BASED STATE MACHINES
COMBINATIONAL PLD-BASED STATE MACHINES
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
 
Cn ppt
Cn  pptCn  ppt
Cn ppt
 
Input - output organzation
Input - output organzationInput - output organzation
Input - output organzation
 

Último

Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksMagic Marks
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 

Último (20)

Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 

Functional dependencies and normalization

  • 1.
  • 2.  Functional dependencies play a key role in differentiating good database designs from database design. A functional dependency is a type of constraint that is a generalization of the notion a key Functional dependencies
  • 3. Different definitions to define FD  FD's are constraints on well-formed relations and represent a formalism on the infrastructure of relation. Definition: A functional dependency (FD) on a relation schema R is a constraint X → Y, where X and Y are subsets of attributes of R. Definition: an FD is a relationship between an attribute "Y" and a determinant (1 or more other attributes) "X" such that for a given value of a determinant the value of the attribute is uniquely defined. i. X is a determinant ii. X determines Y iii. Y is functionally dependent on X iv. X → Y v. X →Y is trivial if Y Í X
  • 4.  Definition: An FD X → Y is satisfied in an instance r of R if for every pair of tuples, t and s: if t and s agree on all attributes in X then they must agree on all attributes in Y A key constraint is a special kind of functional dependency: all attributes of relation occur on the right-hand side of the
  • 5.  The determination of functional dependencies is an important part of designing databases in the relational model, and in database normalization and de normalization.  The functional dependencies, along with the attribute domains, are selected so as to generate constraints that would exclude as much data inappropriate to the user domain from the system as possible.
  • 6.  Functional depending set S is irreducible if the set has three following properties:  Each right set of a functional dependency of S contains only one attribute.  Each left set of a functional dependency of S is irreducible. It means that reducing any one attribute from left set will change the content of S (S will lose some information).  Reducing any functional dependency will change the content of S.
  • 7. Properties of functional dependencies  The most important properties are Armstrong's axioms, which are used in database normalization:  Subset Property (Axiom of Reflexivity):  If Y is a subset of X, then X → Y  Augmentation (Axiom of Augmentation):  If X → Y, then XZ → YZ  Transitivity (Axiom of Transitivity):  If X → Y and Y → Z, then X → Z
  • 8.  From these rules, we can derive these secondary rules:  Union:  If X → Y and X → Z, then X → YZ  Decomposition:  If X → YZ, then X → Y and X → Z  Pseudotransitivity:  f X → Y and WY → Z, then XW → Z
  • 9. Closure of set of FD The closure is basically the full set of values that can be determined from a set of known values for a given relationship using its functional dependencies. You use Armstrong's axioms to provide a proof - i.e. Reflexivity, Augmentation, Transitivity. Given R and F a set of FD’s that holds in R: The closure of F in R (denoted F+) is the set of all FD’s in that are logically implied by F
  • 10.
  • 11. Closure of Attribute Set  Given a set  of attributes of R and a set of functional dependencies F, we need a way to find all of the attributes of R that are functionally determined by . This set of attributes is called the closure of  under F and is denoted +. Finding + is useful because:  if + = R, then  is a superkey for R  if we find + for all  R, we've computed F+ (except that we'd need to use decomposition to get all of it).  An algorithm for computing +: result :=  repeat temp := result for each functional dependency    in F do if   result then result := result   until temp = result
  • 13. Algorithm for computing a canonical cover
  • 14. Normalization  Normalization is a systematic way of ensuring that a database structure is suitable for general-purpose querying and free of certain undesirable characteristics—insertion, update, and deletion anomalies—that could lead to a loss of data integrity
  • 15. Normal forms  The normal forms (abbrev. NF) of relational database theory provide criteria for determining a table's degree of vulnerability to logical inconsistencies and anomalies.  The normal forms are applicable to individual tables; to say that an entire database is in normal form n is to say that all of its tables are in normal form n.
  • 16. Types of NF  First Normal Form (1NF)  Second Normal Form (2NF)  Third Normal Form (3NF)  Boyce-Codd Normal Form (BCNF)  Fourth Normal Form (4NF)  Fifth Normal Form (5NF) etc...
  • 17. First Normal Form (1NF)  A table is in 1NF if and only if it is "isomorphic to some relation", which means, specifically, that it satisfies the following five conditions:  There's no top-to-bottom ordering to the rows.  There's no left-to-right ordering to the columns.  There are no duplicate rows.  Every row-and-column intersection contains exactly one value from the applicable domain (and nothing else).  All columns are regular [i.e. rows have no hidden components such as row IDs, object IDs, or hidden timestamps].  Violation of any of these conditions would mean that the table is not strictly relational, and therefore that it is not in 1NF.
  • 18. Second Normal Form (2NF)  Consider atable that is in first normal form (1NF) must meet additional criteria if it is to qualify for second normal form.  Specifically: a 1NF table is in 2NF if and only if, given any candidate key K and any attribute A that is not a constituent of a candidate key, A depends upon the whole of K rather than just a part of it.  In slightly more formal terms: a 1NF table is in 2NF if and only if all its non-prime attributes are functionally dependent on the whole of a candidate key. (A non-prime attribute is one that does not belong to any candidate key.)
  • 19.  Consider a table describing employees' skills: Employees' Skills Employee Skill Current Work Location Jones Typing 114 Main Street Jones Shorthand 114 Main Street Jones Whittling 114 Main Street Bravo Light Cleaning 73 Industrial Way Ellis Alchemy 73 Industrial Way Ellis Flying 73 Industrial Way Harrison Light Cleaning 73 Industrial Way
  • 20.  Neither {Employee} nor {Skill} is a candidate key for the table.  This is because a given Employee might need to appear more than once (he might have multiple Skills), and a given Skill might need to appear more than once (it might be possessed by multiple Employees).  Only the composite key {Employee, Skill} qualifies as a candidate key for the table.  The remaining attribute, Current Work Location, is dependent on only part of the candidate key, namely Employee.  Therefore the table is not in 2NF.
  • 21.  A 2NF alternative to this design would represent the same information in two tables: an "Employees" table with candidate key {Employee}, and an "Employees' Skills" table with candidate key {Employee, Skill}: Employees Employee Current Work Location Jones 114 Main Street Bravo 73 Industrial Way Ellis 73 Industrial Way Harrison 73 Industrial Way Employees' Skills Employee Skill Jones Typing Jones Shorthand Jones Whittling Bravo Light Cleaning Ellis Alchemy Ellis Flying Harrison Light Cleaning
  • 22. Third Normal Form(3NF)  The third normal form (3NF) is a normal form used in database normalization.  3NF was originally defined by E.F. Codd in 1971.  Codd's definition states that a table is in 3NF if and only if both of the following conditions hold:  The relation R (table) is in second normal form (2NF)  Every non-prime attribute of R is non-transitively dependent (i.e. directly dependent) on every candidate key of R.
  • 23.  Basics of 3NF:  A non-prime attribute of R is an attribute that does not belong to any candidate key of R.  A transitive dependency is a functional dependency in which X → Z (X determines Z) indirectly, by virtue of X → Y and Y → Z (where it is not the case that Y → X). OR In other words  A table is in the third normal form if it is the second normal form and there are no non-key columns dependant on other non-key columns that could not act as the primary key.
  • 24.  Example An example of a 2NF table that fails to meet the requirements of 3NF is: Tournament Winners Tournament Year Winner Winner Date of Birth Indiana Invitational 1998 Al Fredrickson 21 July 1975 Cleveland Open 1999 Bob Albertson 28 September 1968 Des Moines Masters 1999 Al Fredrickson 21 July 1975 Indiana Invitational 1999 Chip Masterson 14 March 1977
  • 25.  Because each row in the table needs to tell us who won a particular Tournament in a particular Year, the composite key {Tournament, Year} is a minimal set of attributes guaranteed to uniquely identify a row.  That is, {Tournament, Year} is a candidate key for the table.
  • 26. Tournament Winners Tournament Year Winner Indiana Invitational 1998 Al Fredrickson Cleveland Open 1999 Bob Albertson Des Moines Masters 1999 Al Fredrickson Indiana Invitational 1999 Chip Masterson Player Dates of Birth Player Date of Birth Chip Masterson 14 March 1977 Al Fredrickson 21 July 1975 Bob Albertson 28 September 1968 In order to express the same facts without violating 3NF, it is necessary to split the table into two:
  • 27. Boyce-Codd Normal Form (BCNF)  Boyce-Codd normal form (or BCNF or 3.5NF) is a normal form used in database normalization.  It is a slightly stronger version of the third normal form (3NF).  A table is in Boyce-Codd normal form if and only if for every one of its non-trivial [dependencies] X → Y, X is a super key— that is, X is either a candidate key or a superset thereof.  BCNF was developed in 1974 by Raymond F. Boyce and Edgar F. Codd to address certain types of anomaly not dealt with by 3NF as originally defined.  Only in rare cases does a 3NF table not meet the requirements of BCNF.  Depending on what its functional dependencies are, a 3NF table with two or more overlapping candidate keys may or may not be in BCNF.
  • 28. Main Difference Between BCNF And 3NF Most relations in 3NF are also in BCNF, the only time this may not be true is when there is more than one candidate key for a relation and at least one of is composite in 3NF.
  • 29. Fourth Normal Form(4NF)  Fourth normal form (or 4NF) requires that there be no non-trivial multivalve dependencies of attribute sets on something other than a superset of a candidate key. A table is said to be in 4NF if and only if it is in the BCNF and multivalued dependencies are functional dependencies. The 4NF removes unwanted data structures: multivalued dependencies.
  • 30. Fifth Normal Form(5NF)  Fifth normal form (5NF and also PJ/NF) requires that there are no non-trivial join dependencies that do not follow from the key constraints. A table is said to be in the 5NF if and only if it is in 4NF and every join dependency in it is implied by the candidate keys.