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.

More Related Content

What's hot

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
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
koolkampus
 
Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structure
kalyanineve
 
Decomposition methods in DBMS
Decomposition methods in DBMSDecomposition methods in DBMS
Decomposition methods in DBMS
soniyagoyal3
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
Nishant Munjal
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalization
daxesh chauhan
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
Saranya Natarajan
 
serializability in dbms
serializability in dbmsserializability in dbms
serializability in dbms
Saranya Natarajan
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
Hitesh Mohapatra
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
Kabindra Koirala
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
Roshni Singh
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
emailharmeet
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
sadique_ghitm
 
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
 
Normalization
NormalizationNormalization
Normalization
Sakshi Jaiswal
 
Normalization
NormalizationNormalization
Normalization
momo2187
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
Visakh V
 
Fragmentation and types of fragmentation in Distributed Database
Fragmentation and types of fragmentation in Distributed DatabaseFragmentation and types of fragmentation in Distributed Database
Fragmentation and types of fragmentation in Distributed Database
Abhilasha Lahigude
 
Lossless decomposition
Lossless decompositionLossless decomposition
Lossless decomposition
MANASYJAYASURYA
 

What's hot (20)

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
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structure
 
Decomposition methods in DBMS
Decomposition methods in DBMSDecomposition methods in DBMS
Decomposition methods in DBMS
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Relational model
Relational modelRelational model
Relational model
 
Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalization
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
serializability in dbms
serializability in dbmsserializability in dbms
serializability in dbms
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
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
 
Normalization
NormalizationNormalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
 
Fragmentation and types of fragmentation in Distributed Database
Fragmentation and types of fragmentation in Distributed DatabaseFragmentation and types of fragmentation in Distributed Database
Fragmentation and types of fragmentation in Distributed Database
 
Lossless decomposition
Lossless decompositionLossless decomposition
Lossless decomposition
 

Similar to Functional dependency

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

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
 
Relations & functions
Relations & functionsRelations & functions
Relations & functions
 
Determinants
DeterminantsDeterminants
Determinants
 
1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन
1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन
1 MARK TYPE (विभिन्न माध्यमों के लिए लेखन
 
function
functionfunction
function
 
Relation and function_xii
Relation and function_xiiRelation and function_xii
Relation and function_xii
 
18560 lecture6
18560 lecture618560 lecture6
18560 lecture6
 
Lecture co3 math21-1
Lecture co3 math21-1Lecture co3 math21-1
Lecture co3 math21-1
 
Relations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdfRelations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdf
 
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
 
Database Management System [DBMS]
Database Management System [DBMS]Database Management System [DBMS]
Database Management System [DBMS]
 
Regression Analysis.pdf
Regression Analysis.pdfRegression Analysis.pdf
Regression Analysis.pdf
 
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)
 
Maths chapter wise Important questions
Maths chapter wise Important questionsMaths chapter wise Important questions
Maths chapter wise Important questions
 
TABREZ KHAN.ppt
TABREZ KHAN.pptTABREZ KHAN.ppt
TABREZ KHAN.ppt
 
Relations & functions.pps
Relations  &  functions.ppsRelations  &  functions.pps
Relations & functions.pps
 
Data normalization
Data normalizationData normalization
Data normalization
 
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
 
Project in Calcu
Project in CalcuProject in Calcu
Project in Calcu
 
Corr-and-Regress (1).ppt
Corr-and-Regress (1).pptCorr-and-Regress (1).ppt
Corr-and-Regress (1).ppt
 

Recently uploaded

5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
nooriasukmaningtyas
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 

Recently uploaded (20)

5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 

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.