SlideShare a Scribd company logo
 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.

More Related Content

What's hot

Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Arun Sharma
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
Roshni Singh
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Oum Saokosal
 
Normalization
NormalizationNormalization
Normalization
meet darji
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
University of Potsdam
 
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
Biplap Bhattarai
 
database Normalization
database Normalizationdatabase Normalization
database Normalization
Harsiddhi Thakkar
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
bit allahabad
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
Prateek Parimal
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
Nishant Munjal
 
Normal forms
Normal formsNormal forms
Normal forms
Samuel Igbanogu
 
Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management System
Drishti Bhalla
 
Normalization
NormalizationNormalization
Normalization
Salman Memon
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
Jargalsaikhan Alyeksandr
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
Chirag vasava
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
Oum Saokosal
 
Er model ppt
Er model pptEr model ppt
Er model ppt
Pihu Goel
 
Normalization in RDBMS
Normalization in RDBMSNormalization in RDBMS
Normalization in RDBMS
JananiSelvaraj10
 
Normalization 1 nf,2nf,3nf,bcnf
Normalization 1 nf,2nf,3nf,bcnf Normalization 1 nf,2nf,3nf,bcnf
Normalization 1 nf,2nf,3nf,bcnf
Shriya agrawal
 

What's hot (20)

Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
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
NormalizationNormalization
Normalization
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
 
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
database Normalizationdatabase Normalization
database Normalization
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Normal forms
Normal formsNormal forms
Normal forms
 
Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management System
 
Normalization
NormalizationNormalization
Normalization
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Normalization in RDBMS
Normalization in RDBMSNormalization in RDBMS
Normalization in RDBMS
 
Normalization 1 nf,2nf,3nf,bcnf
Normalization 1 nf,2nf,3nf,bcnf Normalization 1 nf,2nf,3nf,bcnf
Normalization 1 nf,2nf,3nf,bcnf
 

Viewers also liked

functional dependencies with example
functional dependencies with examplefunctional dependencies with example
functional dependencies with example
Siddhi 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
 
Shashi DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi  DATABASE FUNCTIONAL DEPENDENCY QUESTIONShashi  DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi 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
 
DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
Jitendra Tomar
 
Multivalued dependency
Multivalued dependencyMultivalued dependency
Multivalued dependencyavniS
 
DBMS - FIRST NORMAL FORM
DBMS - FIRST NORMAL FORMDBMS - FIRST NORMAL FORM
DBMS - FIRST NORMAL FORM
MANISH T I
 
Database Dependency with NetVisn
Database Dependency with NetVisnDatabase Dependency with NetVisn
Database Dependency with NetVisn
Envisn
 
Dbms unit-3
Dbms unit-3Dbms unit-3
Dbms unit-3
MUKESH KUMAR
 
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 - Normalization
Ericka Tagarda
 
Normalization
NormalizationNormalization
Normalization
rehanlko007
 
Normalization form tutorial
Normalization form tutorialNormalization form tutorial
Normalization form tutorialNikhildas P C
 

Viewers also liked (16)

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
 
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
 
Bcnf
BcnfBcnf
Bcnf
 
Multivalued dependency
Multivalued dependencyMultivalued dependency
Multivalued dependency
 
Normlaization
NormlaizationNormlaization
Normlaization
 
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 to Functional dependencies and normalization

Function Dependencies and Normalization
 Function Dependencies and Normalization Function Dependencies and Normalization
Function Dependencies and Normalization
BLDE'S S.S.M.Polytechnic,Vijayapur
 
Types of normalization
Types of normalizationTypes of normalization
Types of normalization
PratibhaRashmiSingh
 
a - Normalizing a Data Model
a - Normalizing a Data Modela - Normalizing a Data Model
a - Normalizing a Data ModelDimara Hakim
 
Database normalization
Database normalizationDatabase normalization
Database normalization
Vaibhav Kathuria
 
functional dependency in engineering.pptx
functional dependency in engineering.pptxfunctional dependency in engineering.pptx
functional dependency in engineering.pptx
amanchouhan9917
 
Normalization1
Normalization1Normalization1
Normalization basde dON SHDIEHGFJSGDFGI
Normalization basde dON  SHDIEHGFJSGDFGINormalization basde dON  SHDIEHGFJSGDFGI
Normalization basde dON SHDIEHGFJSGDFGI
arindamdas591494
 
Normalization
NormalizationNormalization
Normalization
Dabbal Singh Mahara
 
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
ijdms
 
Chapter10
Chapter10Chapter10
Chapter10
sasa_eldoby
 
Unit 3 dbms
Unit 3 dbmsUnit 3 dbms
Unit 3 dbms
Sweta Singh
 
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
 
Normalization
NormalizationNormalization
Normalization
Vishal Patil
 
Ism normalization pine valley 2012
Ism normalization pine valley 2012Ism normalization pine valley 2012
Ism normalization pine valley 2012
Akshit 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
Normalization
momo2187
 
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
pritikulkarni20
 

Similar to 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
 

More from daxesh chauhan

Rsa and diffie hellman algorithms
Rsa and diffie hellman algorithmsRsa and diffie hellman algorithms
Rsa and diffie hellman algorithms
daxesh 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 ppt
daxesh chauhan
 
Cn ppt
Cn  pptCn  ppt
Input - output organzation
Input - output organzationInput - output organzation
Input - output organzation
daxesh chauhan
 

More from 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
 

Recently uploaded

ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 

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.