SlideShare a Scribd company logo
FUNCTIONAL
DEPENDENCY
MANASY JAYASURYA
Dept. of Computer Science & Applications
St.Mary’s College, Thrissur
CONTENTS
Definition
Functional Dependency Example
Keys
Closure
Axioms
Example
2
Definition
 A functional dependency is defined as a constraint
between two sets of attributes in a relation from a
database.
Explanation
 Given a relation R, a set of attributes X in R is said to
functionally determine another attribute Y, also in R,
(written X → Y) if and only if each X value is
associated with at most one Y value.
 Here X is the determinant set and Y is the dependent
attribute.
Trivial Dependencies
 Functional Dependency is trivial if and only if right
side is the subset of left side.
3
Example
Employee
SSNSSN NameName JobTypeJobType DeptNameDeptName
557-78-6587557-78-6587 Lance SmithLance Smith AccountantAccountant SalarySalary
214-45-2398214-45-2398 Lance SmithLance Smith EngineerEngineer ProductProduct
Note: Name is functionally dependent on SSN because
an employee’s name can be uniquely determined from
their SSN. Name does not determine SSN, because
more than one employee can have the same name..
4
Keys
Key is a set of attributes that uniquely
identifies an entire tuple.
Functional dependency allows to express
constraints that uniquely identify the values of
certain attributes.
However, a candidate key is always a
determinant, but a determinant doesn’t need to
be a key.
5
Closure
 Let a relation R have some functional
dependencies F specified. The closure of F
(usually written as F+) is the set of all functional
dependencies that may be logically derived from
F. Often F is the set of most obvious and important
functional dependencies and F+, the closure, is the
set of all the functional dependencies including F
and those that can be deduced from F.
 The closure is important and may, needed in
finding one or more candidate keys of the relation.
6
Axioms for finding Closure of a relation
1. Reflexivity Rule --- If X is a set of attributes and Y is a subset of X, then X
→ Y holds.
2. Augmentation Rule --- If X → Y holds and W is a set of attributes, then
WX → WY holds.
3. Transitivity Rule --- If X → Y and Y → Z holds, then X → Z holds.
Derived Theorems from Axioms
4. Union Rule --- If X → Y and X → Z holds, then X → YZ holds.
5. Decomposition Rule --- If X → YZ holds, then so do X → Y and X → Z.
6. Pseudotransitivity Rule --- If X → Y and WY → Z hold then so does WX
→ Z.
7. Self-determination--- A → A
8. Composition --- If A → B and C → D then AC → BD
9. General Unification Theorem ---
If A → B and C → D , then A U (C-B) → BD 7
Example
Student
SNoSNo SNameSName CNoCNo CNameCName AddrAddr Instr.Instr. OfficeOffice
54255425 SusanSusan
RossRoss
102102 Calc ICalc I ……SanSan
Jose,Jose,
CACA
P.P.
SmithSmith
B42B42
RoomRoom
112112
78457845 DaveDave
TurcoTurco
541541 Bio 10Bio 10 ......SanSan
Diego,Diego,
CACA
L.L.
TalipTalip
B24B24
RoomRoom
210210
SNo -> SName CNo -> CName Instr -> Office
SNo -> Addr CNo -> Instr
8
Back to the Example
SNoSNo SNameSName CNoCNo CNameCName AddrAddr Instr.Instr. OfficeOffice
Based on the rules provided, the following dependencies can be
derived.
(SNo, CNo) →→ SNo (Rule 1) -- subset
(SNo, CNo) →→ CNo (Rule 1)
(SNo, CNo) →→ (SName, CName) (Rule 2) -- augmentation
CNo →→ office (Rule 3) -- transitivity
SNo →→ (SName, address) (Union Rule)
etc.
9
THANK YOU
10

More Related Content

What's hot

Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management System
Drishti Bhalla
 
Dbms normalization
Dbms normalizationDbms normalization
Dbms normalization
Pratik Devmurari
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
University of Potsdam
 
Normalization
NormalizationNormalization
Normalization
Dabbal Singh Mahara
 
Normalization
NormalizationNormalization
Normalization
Sakshi Jaiswal
 
Query optimization
Query optimizationQuery optimization
Query optimization
Pooja Dixit
 
Dbms 4NF & 5NF
Dbms 4NF & 5NFDbms 4NF & 5NF
Dbms 4NF & 5NF
Soham Kansodaria
 
Codd's rules
Codd's rulesCodd's rules
Codd's rulesMohd Arif
 
Dbms 14: Relational Calculus
Dbms 14: Relational CalculusDbms 14: Relational Calculus
Dbms 14: Relational Calculus
Amiya9439793168
 
Relational Calculus
Relational CalculusRelational Calculus
Relational Calculus
Dr. C.V. Suresh Babu
 
Normalisation
NormalisationNormalisation
Normalisation
Soumyajit Dutta
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
Megha Patel
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational Calculus
Kunal Anand
 
Specification-of-tokens
Specification-of-tokensSpecification-of-tokens
Specification-of-tokens
Dattatray Gandhmal
 
Semantic Networks
Semantic NetworksSemantic Networks
Semantic Networks
Jenny Galino
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
AJAL A J
 

What's hot (20)

Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management System
 
Dbms normalization
Dbms normalizationDbms normalization
Dbms normalization
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
 
Normalization
NormalizationNormalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Query optimization
Query optimizationQuery optimization
Query optimization
 
Dbms 4NF & 5NF
Dbms 4NF & 5NFDbms 4NF & 5NF
Dbms 4NF & 5NF
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Codd's rules
Codd's rulesCodd's rules
Codd's rules
 
Dbms 14: Relational Calculus
Dbms 14: Relational CalculusDbms 14: Relational Calculus
Dbms 14: Relational Calculus
 
Relational Calculus
Relational CalculusRelational Calculus
Relational Calculus
 
Normalisation
NormalisationNormalisation
Normalisation
 
Unit05 dbms
Unit05 dbmsUnit05 dbms
Unit05 dbms
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational Calculus
 
Specification-of-tokens
Specification-of-tokensSpecification-of-tokens
Specification-of-tokens
 
control unit
control unitcontrol unit
control unit
 
Semantic Networks
Semantic NetworksSemantic Networks
Semantic Networks
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
 

Recently uploaded

Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 

Recently uploaded (20)

Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 

Functional Dependency

  • 1. FUNCTIONAL DEPENDENCY MANASY JAYASURYA Dept. of Computer Science & Applications St.Mary’s College, Thrissur
  • 3. Definition  A functional dependency is defined as a constraint between two sets of attributes in a relation from a database. Explanation  Given a relation R, a set of attributes X in R is said to functionally determine another attribute Y, also in R, (written X → Y) if and only if each X value is associated with at most one Y value.  Here X is the determinant set and Y is the dependent attribute. Trivial Dependencies  Functional Dependency is trivial if and only if right side is the subset of left side. 3
  • 4. Example Employee SSNSSN NameName JobTypeJobType DeptNameDeptName 557-78-6587557-78-6587 Lance SmithLance Smith AccountantAccountant SalarySalary 214-45-2398214-45-2398 Lance SmithLance Smith EngineerEngineer ProductProduct Note: Name is functionally dependent on SSN because an employee’s name can be uniquely determined from their SSN. Name does not determine SSN, because more than one employee can have the same name.. 4
  • 5. Keys Key is a set of attributes that uniquely identifies an entire tuple. Functional dependency allows to express constraints that uniquely identify the values of certain attributes. However, a candidate key is always a determinant, but a determinant doesn’t need to be a key. 5
  • 6. Closure  Let a relation R have some functional dependencies F specified. The closure of F (usually written as F+) is the set of all functional dependencies that may be logically derived from F. Often F is the set of most obvious and important functional dependencies and F+, the closure, is the set of all the functional dependencies including F and those that can be deduced from F.  The closure is important and may, needed in finding one or more candidate keys of the relation. 6
  • 7. Axioms for finding Closure of a relation 1. Reflexivity Rule --- If X is a set of attributes and Y is a subset of X, then X → Y holds. 2. Augmentation Rule --- If X → Y holds and W is a set of attributes, then WX → WY holds. 3. Transitivity Rule --- If X → Y and Y → Z holds, then X → Z holds. Derived Theorems from Axioms 4. Union Rule --- If X → Y and X → Z holds, then X → YZ holds. 5. Decomposition Rule --- If X → YZ holds, then so do X → Y and X → Z. 6. Pseudotransitivity Rule --- If X → Y and WY → Z hold then so does WX → Z. 7. Self-determination--- A → A 8. Composition --- If A → B and C → D then AC → BD 9. General Unification Theorem --- If A → B and C → D , then A U (C-B) → BD 7
  • 8. Example Student SNoSNo SNameSName CNoCNo CNameCName AddrAddr Instr.Instr. OfficeOffice 54255425 SusanSusan RossRoss 102102 Calc ICalc I ……SanSan Jose,Jose, CACA P.P. SmithSmith B42B42 RoomRoom 112112 78457845 DaveDave TurcoTurco 541541 Bio 10Bio 10 ......SanSan Diego,Diego, CACA L.L. TalipTalip B24B24 RoomRoom 210210 SNo -> SName CNo -> CName Instr -> Office SNo -> Addr CNo -> Instr 8
  • 9. Back to the Example SNoSNo SNameSName CNoCNo CNameCName AddrAddr Instr.Instr. OfficeOffice Based on the rules provided, the following dependencies can be derived. (SNo, CNo) →→ SNo (Rule 1) -- subset (SNo, CNo) →→ CNo (Rule 1) (SNo, CNo) →→ (SName, CName) (Rule 2) -- augmentation CNo →→ office (Rule 3) -- transitivity SNo →→ (SName, address) (Union Rule) etc. 9