SlideShare a Scribd company logo
Relational database
Relational database is a set of tables containing data . Each table (which
is sometimes called a relation) contains one or more data categories in
columns . the relational schema R contains a set S of attributes
(A1,A2,A3,…..,An) where attribute A is defined on domain Di for 1<=i<=n
. The relation defined on schema R is a finite set of tuples (t1,t2,….tn) .
The relation is represented by r or r(R) . Here r is the name of the
relation and R is the schema on which r is defined.
Tables are also knows as relation.
Columns are known as attribute.
A B C
x y z
a r h
v f G
w(a , b ,c)Here w is the name of relation and a , b & c
are attributes of relation w.
Relations can be represented as
relation W relation Student
A B C
x y z
a r h
v f G
id name branch
1 gg3 IT
2 gg2 CS
3 gg1 EC
W(ABC) Student(id name branch)
attributes
ABC are the attributes of relation W Id name branch are the attributes of student relation
Functional dependency
In relational database theory, a functional dependency(a->b) is a
constraint between two sets of attributes in a relation from a database.
In other words, functional dependency is a constraint that describes
the relationship between attributes in a relation.
Dependency (a->b) means that if we know value of a we can find value
of b easily.
a b
X Y
X Y
z Z
For same values of a ,values of b are
also same so dependency a->b holds
good.
r(a,b)
a b c d
X p z a
X p z b
X q t c
For same values of ab , values of c are
same so dependency ab->c holds good
R(a , b,c,d)
Functional dependency
there is a relation R(a , b) .
R={a , b}
subsets of R ={{a , b},{a},{b},{}}
a & b both are subsets of R
a ⊆ R ,b ⊆ R
If values of a in more than one tuples are same
and values of b are also same for those tuples
Then there is functional dependency a->b .
if Functional dependency (fd) a -> b exists .
t1[a]=t2[a]
then it must be true for dependency existence i.e.
t1[b]=t2[b]
NOTE :: on same values of a it is impossible to get different values of b on a->b .
Relation R(ab)
a b
t1 x y
t2 x y
t3 z v
Objective:: Check on relation R whether Functional dependency (a->b)
exists or not?
Solution---
In this problem we have two different values of b on same values of a.
t1[a]=t2[a]
But t1[b] != t2[b]
so Dependency does not exist.
Relation R(ab)
Different values of b
a b
x y
x z
z v
Same values of a
Types of dependency(x ->y)
Trivial dependency
Ab->b
In trivial dependency y(b) is a
subset of x(ab).
y⊆ x
Dependency exists but it is
not efficient because we get
insignificant information in this
dependency .
Non trivial dependency
ab->bc
In non trivial dependency y(bc)
is not subset of x(ab)
If y ⊆ x
Dependency exists also in this
case and it is more efficient
because in this dependency
we can get information more
than trivial dependency.
x y x y
Objective:: check following dependencies holds good or not on relation
R
1. a->bc
2. de->c
3. c->de
R(a,b,c,d,e)
a b c d e
T1 x 2 3 4 5
T2 2 a 3 4 5
T3 x 2 3 6 5
t4 x 2 3 6 6
dependencies
a ->bc
In functional dependency x->y ,as we know for same values of x , y should be
same.
Fd  a->bc
For same values of a , there are
same values of bc so dependency
Holds good .
As t1[x]=t3[x]=t4[x]
Then t1[y]=t3[y]=t4[y]
From given relation
For every a=x
bc=23
So a -> bc dependency exist.
de ->c
As we know , for same values of x , y should be same.
As t1[x]=t2[x]
Then t1[y]=t2[y]
So dependency holds good.
There is no problem in searching each value of y w.r.t x .
For every unique value of x there is unique value of y.
a b c d e
T1 x 2 3 4 5
T2 2 a 3 4 5
T3 x 2 3 6 5
t4 x 2 3 6 6
C->de
As we know , for same values of x , y should be same.
As t1[x]=t2[x]=t3[x]=t4[x]
Then t1[y]=t2[y]!= t3[y]!=t4[y]
For every c= 3
de is not same
So dependency
c -> de does not exist.
a b c d e
T1 x 2 3 4 5
T2 2 a 3 4 5
T3 x 2 3 6 5
t4 x 2 3 6 6
note – in functional dependency x->y
If all the values of x are different then dependency always exist.
If all values of y are same then dependency always exist.
for normalization functional dependency is used as tool .
a b C
s j P
R e P
q W q
Dependency ab->c
always exist in this
relation.
a b C
s j P
R e P
q W p
Dependency ab->c
always exist in this
relation.
Closure of set of functional dependencies
Let F is set of all functional dependencies.
Then closure of set of functional dependencies is the set of all
functional dependencies that can be inferred(guessed) from F.
Objective :: F={(a->b),(ab->c)}
check functional dependency( bd->cd )exist or not.
Solution-
a ->b
ab ->c
b ->c
bd->cd (augmentation rule)
Dependency bd -> cd exist.
Inference rules
There are 6 inference rules for functional dependencies.
IR1-{reflexive rule}
IR2-{augmentation rule}
IR3-{transitivity rule}
IR4-{union rule}
IR5-{decomposition rule}
IR6-{pseudo transitivity rule}
RAT axioms or
ARMSTRONG’s axiom
axioms
An axiom is a statement that is taken to be true,
to serve as starting point for further reasoning
and arguments.
Reflexivity rule-IR1
If x is a set of attributes and y⊆ x , then x->y holds i.e. if y is a subset of
x then x->y holds. A functional dependency is said to be trivial if y⊆ x .
Augmentation rule-IR2
If x->y holds then xz->y and xz->yz also holds i.e. if we augment a set of
attributes z to the left side or to both side of fd x->y , then resultant fd
also hold.
If x->y is holds and z is a set of attributes , then z x->z y holds.
Transitivity rule- IR3
If x->y holds and y->z holds , then x->z also holds.
These three rules are known as Armstrong axioms and these are sound ,
because they do not generate any incorrect functional dependency.
Union rule-IR4
If x->y holds and x->z holds , then x->yz holds.
Decomposition rule-IR5
If x->yz holds , then x->y holds , x->z holds.
Pseudo transitivity rule-IR6
If x->y holds and zy->q holds ,then zx->q holds.
Objective- given relation R(a,b,c,d,e,f,g) and a set of FD {a->b ,
abcd->e , ef->g } IS acdf->g, implied by the set of given fd’s?
Solution-
given a->b
abcd->e
ef->g
Abcd->e
Aacd->e
implies acd->e(by pseudotransitivity rule)
acdf->ef(by augmentation rule)
acdf->g( by transitivity rule)
hence acdf->g
Hence acdf->g by the set of fd.
Closure set of attributes
Given R(a,b,c)
Fd’s a-> b
b->c
with the help of a we can get b
From b we can find c
So all the attributes can be derived from given dependencies so closure
of a+ ={abc} .
let F= total set of dependency.
F=f1+f2
Dependencies
which are
directly
visible
Dependencies
that are not
directly visible
F1=A->b
F2= A->c
F=A->bc
a+ = { abc}
b+ ={bc}
C+ ={c}
Closure is represented by attribute + symbol.
1. Objective : given R(a,b,c,d,e,f,g)
dependencies
a->b
bc->de
aeg->g
Find (ac)+ .
solution –
let x={ac}
X1={abc} (by 1 dependency)
X2={abcde} (by 2 dependency)
We can not use 3 dependency because we do not have g .
(ac)+ =x2
hence (ac)+ ={abcde}
2. Objective :given R(a,b,c,d,e)
fd { a->bc , cd->e, b->d, e->a}
find b+ .
let x={b}
X1={bd} (by 3 dependency)
b+=x1
So (b)+ = {bd}.
note ---------Cd is not used because it is not possible
Ab->c
A->b
A->c
Objective: R(abcdef)
Fd ’ s ab->c
bc->ad
d->e
cf->b
Find (ab)+.
Solution-
let x={ab}
X1={abc} (by 1 dependency)
X2={abcd} (by 2 dependency)
X3={abcde} (by 3 dependency)
(ab)+ =x3= {abcde}
Objective: given R(abcdefgh)
A->bc
Cd->e
E->c
D->aeh
Abh->bd
Dh->bc
Check bcd->h is this dependency is valid or not??
Solution-
(bcd)+ = {bcdaeh}
closure of bcd contains h so bcd->h dependency is valid.
Canonical form/irreducible form
In canonical form we check that there is any redundant element exist
or not , if there is any redundant element exist then remove it .
Redundant –
If presence or absence of element do not effect capability of given
functional dependency , then we have to eliminate that dependency, it
is considered as minimization.
R(w,x,y,z)
x->w
wz->xy
y->wxz
Irreducible form –
A set F of FDs is non redundant (irreducible)if there is no proper
subset F’ of F with F' ≡ F. If such an F' exists, F is
redundant(redundant).
In this problem functional dependency{ wz->x ,x->w }are
redundant.
Note-
If there is any dependency from P->Q
1.Then it may be redundancy on left side
2.It may be redundancy on right side
3.It may be redundancy on both side.
Steps-
1.Apply decomposition
2.Find closure set of attribute for each dependency one by one.
3.Then reduce dependency and find closure set for perticular
attribute one by one .
If closure set of attributes computed from 2 is equal to closure
set of attribute from 3 .then dependency can be reduce .now
remove that dependency at that time.
4.Continue step 2&3 for each. If closure from step 2 is not equal
to closure from 3 then dependency is compulsory.
5. After computing all the closure apply composition rule.
Objective : given R(wxyz)
x->w
wz->xy
y->wxz
Find canonical form.
1) Apply decomposition rule:
1. X->w
2. Wz->x
3. Wz->y
4. Y->w
5. Y->x
6. Y->z
Now redundancy on right side removed.
Find closure->
1. X->w(compulsory)
2. Wz->x
3. Wz->y
4. Y->w
5. Y->x
6. Y->z
For first
Step 2)X+ = {x,w}
If presence or absence of any dependency is not affect on system then
that dependency is redundant.
ignore dependency x->w
3) X+ = {x}
After ignoring 1 dependency power of x is not same so x->w
dependency is compulsory.
1. X->w(compulsory)
2. Wz->x(redundant)
3. Wz->y
4. Y->w
5. Y->x
6. Y->z
for second dependency
2).(wz)+ ={wzxy}
After ignoring wz->x
3).(wz)+ = {wzyx}
In this case after ignoring dependency power of wz is not reduced so it
is redundent .
1. X->w(compulsory)
2. Wz->x(redundant)
3. Wz->y(compulsory)
4. Y->w
5. Y->x
6. Y->z
For third dependency
2).(wz)+ ={wzxy}
After ignoring wz->y
3).(Wz)+ ={wzx}
In this case after ignoring dependency power of wz is reduced
so it is not redundent .
1. X->w(compulsory)
2. Wz->x(redundant)
3. Wz->y(compulsory)
4. Y->w(redundant)
5. Y->x
6. Y->z
For fourth dependency
Y->w
2).Y+ ={ywxz}
After ignoring
3).Y+ ={yxzw}
Dependency y->w is redundant.
1. X->w(compulsory)
2. Wz->x(redundant)
3. Wz->y(compulsory)
4. Y->w(redundant)
5. Y->x(compulsory)
6. Y->z
For fifth dependency
Y->x
2).Y+ ={wzxy}
After ignoring
3).Y+ ={yz}
Dependency is not redundant .it is compulsory.
1. X->w(compulsory)
2. Wz->x(redundant)
3. Wz->y(compulsory)
4. Y-> w(redundant)
5. Y->x(compulsory)
6. Y->z(compulsory)
For sixth dependency
Y->z
2).Y+ = {yzwx}
After ignoring
3).y+ = {xyz}
So this is compulsory .
X->w
Wz->y
Y->z
Y->x
Now for checking redundancy on left side
Compute (wz)+ ={wzyx}
Now reduce attribute one by one and get closure
W+ ={w}
z+ = {z}
Now in this case
Neither w+ nor z+ is equal to (wz)+ so neither w nor z is
redundant.
Both are compulsory.
Final Solution
X->w
Wz->y
Y->xz(on applying composition rule)
This is irreducible canonical form of given problem.
Ad

More Related Content

What's hot (20)

Functional dependency
Functional dependencyFunctional dependency
Functional dependency
Dashani Rajapaksha
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
Tamajit Chakraborty
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Arun Sharma
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
University of Potsdam
 
Normal forms
Normal formsNormal forms
Normal forms
Samuel Igbanogu
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
Visakh V
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancy
Visakh V
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
Damian T. Gordon
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional Dependency
Raj Naik
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
Prateek Parimal
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
GirdharRatne
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
Bipul Roy Bpl
 
Data mining Measuring similarity and desimilarity
Data mining Measuring similarity and desimilarityData mining Measuring similarity and desimilarity
Data mining Measuring similarity and desimilarity
Rushali Deshmukh
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
Vignesh Saravanan
 
Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalization
daxesh chauhan
 
Database fragmentation
Database fragmentationDatabase fragmentation
Database fragmentation
Punjab College Of Technical Education
 
Normalization
NormalizationNormalization
Normalization
Sakshi Jaiswal
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Arun Sharma
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
University of Potsdam
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
Visakh V
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancy
Visakh V
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional Dependency
Raj Naik
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
GirdharRatne
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
Bipul Roy Bpl
 
Data mining Measuring similarity and desimilarity
Data mining Measuring similarity and desimilarityData mining Measuring similarity and desimilarity
Data mining Measuring similarity and desimilarity
Rushali Deshmukh
 
Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalization
daxesh chauhan
 

Similar to Functional dependency (20)

3.1 Functions and Function Notation
3.1 Functions and Function Notation3.1 Functions and Function Notation
3.1 Functions and Function Notation
smiller5
 
Relations & functions
Relations & functionsRelations & functions
Relations & functions
indu thakur
 
Determinants
DeterminantsDeterminants
Determinants
Joey Fontanilla Valdriz
 
1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन
1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन
1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन
VinayMishra859858
 
function
functionfunction
function
som allul
 
Relation and function_xii
Relation and function_xiiRelation and function_xii
Relation and function_xii
Barnali Banerjee
 
18560 lecture6
18560 lecture618560 lecture6
18560 lecture6
Universitas Bina Darma Palembang
 
Lecture co3 math21-1
Lecture co3 math21-1Lecture co3 math21-1
Lecture co3 math21-1
Lawrence De Vera
 
Relations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdfRelations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdf
AakashKushwaha26
 
2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphs2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphs
smiller5
 
Database Management System [DBMS]
Database Management System [DBMS]Database Management System [DBMS]
Database Management System [DBMS]
Shalabh Chaudhary
 
Regression Analysis.pdf
Regression Analysis.pdfRegression Analysis.pdf
Regression Analysis.pdf
ShrutidharaSarma1
 
Class XI CH 2 (relations and functions)
Class XI CH 2 (relations and functions)Class XI CH 2 (relations and functions)
Class XI CH 2 (relations and functions)
Pradeep Sharma
 
Maths chapter wise Important questions
Maths chapter wise Important questionsMaths chapter wise Important questions
Maths chapter wise Important questions
Srikanth KS
 
TABREZ KHAN.ppt
TABREZ KHAN.pptTABREZ KHAN.ppt
TABREZ KHAN.ppt
TabrezKhan733764
 
Relations & functions.pps
Relations  &  functions.ppsRelations  &  functions.pps
Relations & functions.pps
indu psthakur
 
Data normalization
Data normalizationData normalization
Data normalization
Bosco Technical Training Society, Don Bosco Technical School (Aff. GGSIP University, New Delhi)
 
Limit, Continuity and Differentiability for JEE Main 2014
Limit, Continuity and Differentiability for JEE Main 2014Limit, Continuity and Differentiability for JEE Main 2014
Limit, Continuity and Differentiability for JEE Main 2014
Ednexa
 
Project in Calcu
Project in CalcuProject in Calcu
Project in Calcu
patrickpaz
 
Corr-and-Regress (1).ppt
Corr-and-Regress (1).pptCorr-and-Regress (1).ppt
Corr-and-Regress (1).ppt
MuhammadAftab89
 
3.1 Functions and Function Notation
3.1 Functions and Function Notation3.1 Functions and Function Notation
3.1 Functions and Function Notation
smiller5
 
Relations & functions
Relations & functionsRelations & functions
Relations & functions
indu thakur
 
1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन
1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन
1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन
VinayMishra859858
 
Relations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdfRelations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdf
AakashKushwaha26
 
2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphs2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphs
smiller5
 
Database Management System [DBMS]
Database Management System [DBMS]Database Management System [DBMS]
Database Management System [DBMS]
Shalabh Chaudhary
 
Class XI CH 2 (relations and functions)
Class XI CH 2 (relations and functions)Class XI CH 2 (relations and functions)
Class XI CH 2 (relations and functions)
Pradeep Sharma
 
Maths chapter wise Important questions
Maths chapter wise Important questionsMaths chapter wise Important questions
Maths chapter wise Important questions
Srikanth KS
 
Relations & functions.pps
Relations  &  functions.ppsRelations  &  functions.pps
Relations & functions.pps
indu psthakur
 
Limit, Continuity and Differentiability for JEE Main 2014
Limit, Continuity and Differentiability for JEE Main 2014Limit, Continuity and Differentiability for JEE Main 2014
Limit, Continuity and Differentiability for JEE Main 2014
Ednexa
 
Project in Calcu
Project in CalcuProject in Calcu
Project in Calcu
patrickpaz
 
Corr-and-Regress (1).ppt
Corr-and-Regress (1).pptCorr-and-Regress (1).ppt
Corr-and-Regress (1).ppt
MuhammadAftab89
 
Ad

Recently uploaded (20)

6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink DisplayHow to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
CircuitDigest
 
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdfLittle Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
gori42199
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
Automatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and BeyondAutomatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and Beyond
NU_I_TODALAB
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
AI Publications
 
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Journal of Soft Computing in Civil Engineering
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
Guru Nanak Technical Institutions
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink DisplayHow to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
CircuitDigest
 
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdfLittle Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
gori42199
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
Automatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and BeyondAutomatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and Beyond
NU_I_TODALAB
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
AI Publications
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Ad

Functional dependency

  • 1. Relational database Relational database is a set of tables containing data . Each table (which is sometimes called a relation) contains one or more data categories in columns . the relational schema R contains a set S of attributes (A1,A2,A3,…..,An) where attribute A is defined on domain Di for 1<=i<=n . The relation defined on schema R is a finite set of tuples (t1,t2,….tn) . The relation is represented by r or r(R) . Here r is the name of the relation and R is the schema on which r is defined. Tables are also knows as relation. Columns are known as attribute. A B C x y z a r h v f G w(a , b ,c)Here w is the name of relation and a , b & c are attributes of relation w.
  • 2. Relations can be represented as relation W relation Student A B C x y z a r h v f G id name branch 1 gg3 IT 2 gg2 CS 3 gg1 EC W(ABC) Student(id name branch) attributes ABC are the attributes of relation W Id name branch are the attributes of student relation
  • 3. Functional dependency In relational database theory, a functional dependency(a->b) is a constraint between two sets of attributes in a relation from a database. In other words, functional dependency is a constraint that describes the relationship between attributes in a relation. Dependency (a->b) means that if we know value of a we can find value of b easily. a b X Y X Y z Z For same values of a ,values of b are also same so dependency a->b holds good. r(a,b) a b c d X p z a X p z b X q t c For same values of ab , values of c are same so dependency ab->c holds good R(a , b,c,d)
  • 4. Functional dependency there is a relation R(a , b) . R={a , b} subsets of R ={{a , b},{a},{b},{}} a & b both are subsets of R a ⊆ R ,b ⊆ R If values of a in more than one tuples are same and values of b are also same for those tuples Then there is functional dependency a->b . if Functional dependency (fd) a -> b exists . t1[a]=t2[a] then it must be true for dependency existence i.e. t1[b]=t2[b] NOTE :: on same values of a it is impossible to get different values of b on a->b . Relation R(ab) a b t1 x y t2 x y t3 z v
  • 5. Objective:: Check on relation R whether Functional dependency (a->b) exists or not? Solution--- In this problem we have two different values of b on same values of a. t1[a]=t2[a] But t1[b] != t2[b] so Dependency does not exist. Relation R(ab) Different values of b a b x y x z z v Same values of a
  • 6. Types of dependency(x ->y) Trivial dependency Ab->b In trivial dependency y(b) is a subset of x(ab). y⊆ x Dependency exists but it is not efficient because we get insignificant information in this dependency . Non trivial dependency ab->bc In non trivial dependency y(bc) is not subset of x(ab) If y ⊆ x Dependency exists also in this case and it is more efficient because in this dependency we can get information more than trivial dependency. x y x y
  • 7. Objective:: check following dependencies holds good or not on relation R 1. a->bc 2. de->c 3. c->de R(a,b,c,d,e) a b c d e T1 x 2 3 4 5 T2 2 a 3 4 5 T3 x 2 3 6 5 t4 x 2 3 6 6 dependencies
  • 8. a ->bc In functional dependency x->y ,as we know for same values of x , y should be same. Fd  a->bc For same values of a , there are same values of bc so dependency Holds good . As t1[x]=t3[x]=t4[x] Then t1[y]=t3[y]=t4[y] From given relation For every a=x bc=23 So a -> bc dependency exist.
  • 9. de ->c As we know , for same values of x , y should be same. As t1[x]=t2[x] Then t1[y]=t2[y] So dependency holds good. There is no problem in searching each value of y w.r.t x . For every unique value of x there is unique value of y. a b c d e T1 x 2 3 4 5 T2 2 a 3 4 5 T3 x 2 3 6 5 t4 x 2 3 6 6
  • 10. C->de As we know , for same values of x , y should be same. As t1[x]=t2[x]=t3[x]=t4[x] Then t1[y]=t2[y]!= t3[y]!=t4[y] For every c= 3 de is not same So dependency c -> de does not exist. a b c d e T1 x 2 3 4 5 T2 2 a 3 4 5 T3 x 2 3 6 5 t4 x 2 3 6 6
  • 11. note – in functional dependency x->y If all the values of x are different then dependency always exist. If all values of y are same then dependency always exist. for normalization functional dependency is used as tool . a b C s j P R e P q W q Dependency ab->c always exist in this relation. a b C s j P R e P q W p Dependency ab->c always exist in this relation.
  • 12. Closure of set of functional dependencies Let F is set of all functional dependencies. Then closure of set of functional dependencies is the set of all functional dependencies that can be inferred(guessed) from F. Objective :: F={(a->b),(ab->c)} check functional dependency( bd->cd )exist or not. Solution- a ->b ab ->c b ->c bd->cd (augmentation rule) Dependency bd -> cd exist.
  • 13. Inference rules There are 6 inference rules for functional dependencies. IR1-{reflexive rule} IR2-{augmentation rule} IR3-{transitivity rule} IR4-{union rule} IR5-{decomposition rule} IR6-{pseudo transitivity rule} RAT axioms or ARMSTRONG’s axiom
  • 14. axioms An axiom is a statement that is taken to be true, to serve as starting point for further reasoning and arguments.
  • 15. Reflexivity rule-IR1 If x is a set of attributes and y⊆ x , then x->y holds i.e. if y is a subset of x then x->y holds. A functional dependency is said to be trivial if y⊆ x . Augmentation rule-IR2 If x->y holds then xz->y and xz->yz also holds i.e. if we augment a set of attributes z to the left side or to both side of fd x->y , then resultant fd also hold. If x->y is holds and z is a set of attributes , then z x->z y holds. Transitivity rule- IR3 If x->y holds and y->z holds , then x->z also holds. These three rules are known as Armstrong axioms and these are sound , because they do not generate any incorrect functional dependency.
  • 16. Union rule-IR4 If x->y holds and x->z holds , then x->yz holds. Decomposition rule-IR5 If x->yz holds , then x->y holds , x->z holds. Pseudo transitivity rule-IR6 If x->y holds and zy->q holds ,then zx->q holds.
  • 17. Objective- given relation R(a,b,c,d,e,f,g) and a set of FD {a->b , abcd->e , ef->g } IS acdf->g, implied by the set of given fd’s? Solution- given a->b abcd->e ef->g Abcd->e Aacd->e implies acd->e(by pseudotransitivity rule) acdf->ef(by augmentation rule) acdf->g( by transitivity rule) hence acdf->g Hence acdf->g by the set of fd.
  • 18. Closure set of attributes Given R(a,b,c) Fd’s a-> b b->c with the help of a we can get b From b we can find c So all the attributes can be derived from given dependencies so closure of a+ ={abc} . let F= total set of dependency. F=f1+f2 Dependencies which are directly visible Dependencies that are not directly visible F1=A->b F2= A->c F=A->bc
  • 19. a+ = { abc} b+ ={bc} C+ ={c} Closure is represented by attribute + symbol.
  • 20. 1. Objective : given R(a,b,c,d,e,f,g) dependencies a->b bc->de aeg->g Find (ac)+ . solution – let x={ac} X1={abc} (by 1 dependency) X2={abcde} (by 2 dependency) We can not use 3 dependency because we do not have g . (ac)+ =x2 hence (ac)+ ={abcde}
  • 21. 2. Objective :given R(a,b,c,d,e) fd { a->bc , cd->e, b->d, e->a} find b+ . let x={b} X1={bd} (by 3 dependency) b+=x1 So (b)+ = {bd}. note ---------Cd is not used because it is not possible Ab->c A->b A->c
  • 22. Objective: R(abcdef) Fd ’ s ab->c bc->ad d->e cf->b Find (ab)+. Solution- let x={ab} X1={abc} (by 1 dependency) X2={abcd} (by 2 dependency) X3={abcde} (by 3 dependency) (ab)+ =x3= {abcde}
  • 23. Objective: given R(abcdefgh) A->bc Cd->e E->c D->aeh Abh->bd Dh->bc Check bcd->h is this dependency is valid or not?? Solution- (bcd)+ = {bcdaeh} closure of bcd contains h so bcd->h dependency is valid.
  • 24. Canonical form/irreducible form In canonical form we check that there is any redundant element exist or not , if there is any redundant element exist then remove it . Redundant – If presence or absence of element do not effect capability of given functional dependency , then we have to eliminate that dependency, it is considered as minimization. R(w,x,y,z) x->w wz->xy y->wxz Irreducible form – A set F of FDs is non redundant (irreducible)if there is no proper subset F’ of F with F' ≡ F. If such an F' exists, F is redundant(redundant). In this problem functional dependency{ wz->x ,x->w }are redundant.
  • 25. Note- If there is any dependency from P->Q 1.Then it may be redundancy on left side 2.It may be redundancy on right side 3.It may be redundancy on both side.
  • 26. Steps- 1.Apply decomposition 2.Find closure set of attribute for each dependency one by one. 3.Then reduce dependency and find closure set for perticular attribute one by one . If closure set of attributes computed from 2 is equal to closure set of attribute from 3 .then dependency can be reduce .now remove that dependency at that time. 4.Continue step 2&3 for each. If closure from step 2 is not equal to closure from 3 then dependency is compulsory. 5. After computing all the closure apply composition rule.
  • 27. Objective : given R(wxyz) x->w wz->xy y->wxz Find canonical form.
  • 28. 1) Apply decomposition rule: 1. X->w 2. Wz->x 3. Wz->y 4. Y->w 5. Y->x 6. Y->z Now redundancy on right side removed.
  • 29. Find closure-> 1. X->w(compulsory) 2. Wz->x 3. Wz->y 4. Y->w 5. Y->x 6. Y->z For first Step 2)X+ = {x,w} If presence or absence of any dependency is not affect on system then that dependency is redundant. ignore dependency x->w 3) X+ = {x} After ignoring 1 dependency power of x is not same so x->w dependency is compulsory.
  • 30. 1. X->w(compulsory) 2. Wz->x(redundant) 3. Wz->y 4. Y->w 5. Y->x 6. Y->z for second dependency 2).(wz)+ ={wzxy} After ignoring wz->x 3).(wz)+ = {wzyx} In this case after ignoring dependency power of wz is not reduced so it is redundent .
  • 31. 1. X->w(compulsory) 2. Wz->x(redundant) 3. Wz->y(compulsory) 4. Y->w 5. Y->x 6. Y->z For third dependency 2).(wz)+ ={wzxy} After ignoring wz->y 3).(Wz)+ ={wzx} In this case after ignoring dependency power of wz is reduced so it is not redundent .
  • 32. 1. X->w(compulsory) 2. Wz->x(redundant) 3. Wz->y(compulsory) 4. Y->w(redundant) 5. Y->x 6. Y->z For fourth dependency Y->w 2).Y+ ={ywxz} After ignoring 3).Y+ ={yxzw} Dependency y->w is redundant.
  • 33. 1. X->w(compulsory) 2. Wz->x(redundant) 3. Wz->y(compulsory) 4. Y->w(redundant) 5. Y->x(compulsory) 6. Y->z For fifth dependency Y->x 2).Y+ ={wzxy} After ignoring 3).Y+ ={yz} Dependency is not redundant .it is compulsory.
  • 34. 1. X->w(compulsory) 2. Wz->x(redundant) 3. Wz->y(compulsory) 4. Y-> w(redundant) 5. Y->x(compulsory) 6. Y->z(compulsory) For sixth dependency Y->z 2).Y+ = {yzwx} After ignoring 3).y+ = {xyz} So this is compulsory .
  • 35. X->w Wz->y Y->z Y->x Now for checking redundancy on left side Compute (wz)+ ={wzyx} Now reduce attribute one by one and get closure W+ ={w} z+ = {z} Now in this case Neither w+ nor z+ is equal to (wz)+ so neither w nor z is redundant. Both are compulsory.
  • 36. Final Solution X->w Wz->y Y->xz(on applying composition rule) This is irreducible canonical form of given problem.
  翻译: