SlideShare a Scribd company logo
1 of 19
Download to read offline
FUNCTIONAL DEPENDENCY
PRINCIPLES OF DATA AND KNOWLEDGE
BASE SYSTEMS
NAME: ALAA NOOR
MATRIKL NR.: 805642
What is Functional Dependency (FDs)?
Functional dependency is a relationship that exists when one attribute uniquely determines
another attribute.
FDs are a generalization of keys.
It is the central part of relational database design theory.
A functional dependency is denoted by an arrow "→". Such as the functional dependency of A on
B is represented by A →B
EXAMPLE OF FD:
Student_ID Name Age City
01 Alaa 21 Potsdam
02 Iftekhar 25 Potsdam
03 Aziha 22 Berlin
• Here if we know the value of
Student_ID, we can obtain the Name,
Age and City of that student. By this,
we can say that the City, Name, and
Age are functionally dependent on
Student_ID.
• Functional dependency can be written
as: Student_ID → Name, Age, City.
Table 1. Student table
Key Terms:
Key Terms Description
Axiom Axioms is a set of inference rules used to infer all
the functional dependencies on a relational
database.
Decomposition It is a rule that suggests if you have a table that
appears to contain two entities which are
determined by the same primary key(PK) then
you should consider breaking them up into two
different tables.
Dependent It is displayed on the right side of the functional
dependency.
Determinant It is displayed on the left side of the functional
dependency.
Union It suggests that if two tables are separate, and
the PK is the same, you should consider putting
them together.
Table 2. Key terms of Functional Dependency
Rules of Functional Dependency:
1. Reflexive rule : If B is a subset of A, then A→B holds by reflexivity rule.
2. Augmentation rule : It is also known as a partial dependency, it says if A->B
holds, then AC->BC for any attribute C also holds.
3. Transitivity rule : This rule is very much similar to the transitive rule in
algebra if A->B holds and B->C holds, then A->C also holds.
Types of Functional Dependency:
 Transitive Dependency
 Trivial functional dependency
 Non-trivial functional dependency
Figure 1. Types of FDs
Transitive Dependency:
A functional dependency is said to be transitive if it is indirectly formed by
two functional dependencies.
X -> Z is a transitive dependency if the following three functional
dependencies hold true:
• X->Y
• Y does not ->X
• Y->Z
A transitive dependency can only occur in a relation of three or more
attributes. This dependency helps us normalizing the database in 3NF (3rd
Normal Form).
Transitive Dependency Example:
Book Author Author Age
Game of Thrones George R. R. Martin 66
Harry Potter J.K. Rowling 49
Dying of the Light George R. R. Martin 66
• {Book} ->{Author} (if we know the book, we can know the author name)
• {Author} does not -> {Book}
• {Author} -> {Author_age}
Therefore according to the rule of transitive dependency:
• {Book} -> {Author_age} should hold, that makes sense because if we know the book
name we can know the author’s age.
Table 3. Book table
Trivial Functional Dependency:
The dependency of an attribute on a set of attributes is known as trivial
functional dependency if the set of attributes includes that attribute.
Symbolically:
• A ->B is trivial functional dependency if B is a subset of A.
• The following dependencies are also trivial: A->A & B->B
Trivial FD Example:
• {Company_Id, Company_Name} -> {Company_Id} is a trivial functional
dependency as Company_Id is a subset of {Company_Id, Company_Name}.
• Also, Company_Id -> Company_Id & Company_Name -> Company_Name are
trivial dependencies too.
Company_Id Company_Name
C2 Apple
C3 Facebook
C4 Google
Table 4. Company Table
Non-Trivial Functional Dependency
A nontrivial functional dependency occurs when A->B holds true where B is
not a subset of A.
For example:
Company_Id-> Company_Name
The above is non-trivial functional dependency since Company_Name is
not a subset of Company_Id.
Contd..
Any FD such as A1, . . . , An → B1, . . . , Bm will cause redundant storage unless A1,
. . . , An is a key, so that each combination of attribute values for A1, . . . , An can
occur only once.
Avoid (proper) FDs by transforming them into key constraints. This is what
normalization does.
Therefore BCNF is used here.
Boyce-Codd Normal Form (BCNF)
A relational schema R is considered to be in Boyce–Codd normal form (BCNF) if,
for every one of its dependencies A → B, one of the following conditions holds
true:
• A → B is a trivial functional dependency
• A relation R is in BCNF if and only if: whenever there is a nontrivial FD
A1, . . . , An → B1, . . . , Bm for R, it is the case that {A1, A2, ... , An} is a superkey
for R.
#That is, the left side of every nontrivial FD must be a superkey.
Example (Not in BCNF):
The nontrivial functional dependencies in the table are:
• author → nationality
• book title → genre, number of pages
We can easily see that the only KEY is the set {author, book title}
Author Nationality Book Title Genre Number of pages
William
Shakespeare
English The Tempest Comedy 215
Emily Brontë Irish Wuthering Heights Gothic 540
Jeffrey Ullman American Database Systems Textbook 500
Jennifer Widom American Database Systems Textbook 500
Table 5. Author table
Example (in BCNF):
Author Nationality
William Shakespeare English
Emily Brontë Irish
Jeffrey Ullman American
Jennifer Widom American
Author Book Title
William Shakespeare The Tempest
Emily Brontë Wuthering Heights
Jeffrey Ullman Database Systems
Jennifer Widom Database Systems
Table 6. Author1 table Table 7. Author2 table
Contd..
The functional dependencies for this schema are the same as before:
• author → nationality
• book title → genre, number of pages
The key of the first table is {author}. The key of the second table is {author, book title}. The key of the
third table is {book title}. There are no functional dependencies violating the BCNF rules, so the
schema is in Boyce-Codd Normal Form.
Book Title Genre Number of Pages
The Tempest Comedy 215
Wuthering Heights Gothic 540
Database Systems Textbook 500
Table 8. Author3 table
Advantages of Functional Dependency:
• Functional Dependency removes data redundancy where the same values
should not be repeated at multiple locations in the same database table.
• It maintains the quality of data in the database.
• FD allows clearly defined meanings and constraints of databases.
• It helps in identifying bad designs of the database.
• It expresses the facts about the database design.
References
H. Garcia-Molina, J. Ullman, and J.Widom. Database Systems: The Complete
Book. Prentice Hall Press, second edition, 2008. [Ch. 3]
https://www.guru99.com/dbms-functional-dependency.html
https://www.geeksforgeeks.org/types-of-functional-dependencies-in-dbms
https://www.tutorialspoint.com/Functional-dependency-in-DBMS
https://www.tutorialandexample.com/functional-dependencies/
Functional Dependency

More Related Content

What's hot

Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalizationVisakh V
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancyVisakh V
 
Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a DatabaseBishrul Haq
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in DatabaseRoshni Singh
 
Relational Algebra & Calculus
Relational Algebra & CalculusRelational Algebra & Calculus
Relational Algebra & CalculusAbdullah Khosa
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure pptNalinNishant3
 
DBMS Unit 3.pptx
DBMS Unit 3.pptxDBMS Unit 3.pptx
DBMS Unit 3.pptxAmitDrKhare
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Oum Saokosal
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra pptGirdharRatne
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional DependencyRaj Naik
 

What's hot (20)

Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancy
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Normalization
NormalizationNormalization
Normalization
 
Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database
 
Functional Dependency
Functional DependencyFunctional Dependency
Functional Dependency
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Dbms normalization
Dbms normalizationDbms normalization
Dbms normalization
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Relational Algebra & Calculus
Relational Algebra & CalculusRelational Algebra & Calculus
Relational Algebra & Calculus
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure ppt
 
DBMS Unit 3.pptx
DBMS Unit 3.pptxDBMS Unit 3.pptx
DBMS Unit 3.pptx
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional Dependency
 
Normalization
NormalizationNormalization
Normalization
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 

Similar to Functional Dependency

Database normalization
Database normalizationDatabase normalization
Database normalizationJignesh Jain
 
normalization ppt.pptx
normalization ppt.pptxnormalization ppt.pptx
normalization ppt.pptxAbdusSadik
 
Relational database
Relational  databaseRelational  database
Relational databaseamkrisha
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization TechniquesNishant Munjal
 
Data base management system (2)
Data base management system (2)Data base management system (2)
Data base management system (2)MrinalDev1
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdfShivani139202
 
Relational Database design.pptx
Relational Database design.pptxRelational Database design.pptx
Relational Database design.pptxjohndoe193402
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.pptKalpanaThakre2
 
Chapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdfChapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdfTamiratDejene1
 
Database normalization
Database normalizationDatabase normalization
Database normalizationVARSHAKUMARI49
 
Database and Math Relations
Database and Math RelationsDatabase and Math Relations
Database and Math RelationsProf Ansari
 

Similar to Functional Dependency (20)

Normalization
NormalizationNormalization
Normalization
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
normalization ppt.pptx
normalization ppt.pptxnormalization ppt.pptx
normalization ppt.pptx
 
Relational database
Relational  databaseRelational  database
Relational database
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization Techniques
 
DBMS 3.pdf
DBMS 3.pdfDBMS 3.pdf
DBMS 3.pdf
 
Data base management system (2)
Data base management system (2)Data base management system (2)
Data base management system (2)
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdf
 
Dbms ppt
Dbms pptDbms ppt
Dbms ppt
 
Relational Database design.pptx
Relational Database design.pptxRelational Database design.pptx
Relational Database design.pptx
 
L8 design1
L8 design1L8 design1
L8 design1
 
Normalisation
NormalisationNormalisation
Normalisation
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.ppt
 
Dbms
DbmsDbms
Dbms
 
Chapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdfChapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdf
 
Dbms unit ii
Dbms unit iiDbms unit ii
Dbms unit ii
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Functional Dependency.pptx
Functional  Dependency.pptxFunctional  Dependency.pptx
Functional Dependency.pptx
 
UNIT-IV.ppt
UNIT-IV.pptUNIT-IV.ppt
UNIT-IV.ppt
 
Database and Math Relations
Database and Math RelationsDatabase and Math Relations
Database and Math Relations
 

Recently uploaded

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

Functional Dependency

  • 1. FUNCTIONAL DEPENDENCY PRINCIPLES OF DATA AND KNOWLEDGE BASE SYSTEMS NAME: ALAA NOOR MATRIKL NR.: 805642
  • 2. What is Functional Dependency (FDs)? Functional dependency is a relationship that exists when one attribute uniquely determines another attribute. FDs are a generalization of keys. It is the central part of relational database design theory. A functional dependency is denoted by an arrow "→". Such as the functional dependency of A on B is represented by A →B
  • 3. EXAMPLE OF FD: Student_ID Name Age City 01 Alaa 21 Potsdam 02 Iftekhar 25 Potsdam 03 Aziha 22 Berlin • Here if we know the value of Student_ID, we can obtain the Name, Age and City of that student. By this, we can say that the City, Name, and Age are functionally dependent on Student_ID. • Functional dependency can be written as: Student_ID → Name, Age, City. Table 1. Student table
  • 4. Key Terms: Key Terms Description Axiom Axioms is a set of inference rules used to infer all the functional dependencies on a relational database. Decomposition It is a rule that suggests if you have a table that appears to contain two entities which are determined by the same primary key(PK) then you should consider breaking them up into two different tables. Dependent It is displayed on the right side of the functional dependency. Determinant It is displayed on the left side of the functional dependency. Union It suggests that if two tables are separate, and the PK is the same, you should consider putting them together. Table 2. Key terms of Functional Dependency
  • 5. Rules of Functional Dependency: 1. Reflexive rule : If B is a subset of A, then A→B holds by reflexivity rule. 2. Augmentation rule : It is also known as a partial dependency, it says if A->B holds, then AC->BC for any attribute C also holds. 3. Transitivity rule : This rule is very much similar to the transitive rule in algebra if A->B holds and B->C holds, then A->C also holds.
  • 6. Types of Functional Dependency:  Transitive Dependency  Trivial functional dependency  Non-trivial functional dependency Figure 1. Types of FDs
  • 7. Transitive Dependency: A functional dependency is said to be transitive if it is indirectly formed by two functional dependencies. X -> Z is a transitive dependency if the following three functional dependencies hold true: • X->Y • Y does not ->X • Y->Z A transitive dependency can only occur in a relation of three or more attributes. This dependency helps us normalizing the database in 3NF (3rd Normal Form).
  • 8. Transitive Dependency Example: Book Author Author Age Game of Thrones George R. R. Martin 66 Harry Potter J.K. Rowling 49 Dying of the Light George R. R. Martin 66 • {Book} ->{Author} (if we know the book, we can know the author name) • {Author} does not -> {Book} • {Author} -> {Author_age} Therefore according to the rule of transitive dependency: • {Book} -> {Author_age} should hold, that makes sense because if we know the book name we can know the author’s age. Table 3. Book table
  • 9. Trivial Functional Dependency: The dependency of an attribute on a set of attributes is known as trivial functional dependency if the set of attributes includes that attribute. Symbolically: • A ->B is trivial functional dependency if B is a subset of A. • The following dependencies are also trivial: A->A & B->B
  • 10. Trivial FD Example: • {Company_Id, Company_Name} -> {Company_Id} is a trivial functional dependency as Company_Id is a subset of {Company_Id, Company_Name}. • Also, Company_Id -> Company_Id & Company_Name -> Company_Name are trivial dependencies too. Company_Id Company_Name C2 Apple C3 Facebook C4 Google Table 4. Company Table
  • 11. Non-Trivial Functional Dependency A nontrivial functional dependency occurs when A->B holds true where B is not a subset of A. For example: Company_Id-> Company_Name The above is non-trivial functional dependency since Company_Name is not a subset of Company_Id.
  • 12. Contd.. Any FD such as A1, . . . , An → B1, . . . , Bm will cause redundant storage unless A1, . . . , An is a key, so that each combination of attribute values for A1, . . . , An can occur only once. Avoid (proper) FDs by transforming them into key constraints. This is what normalization does. Therefore BCNF is used here.
  • 13. Boyce-Codd Normal Form (BCNF) A relational schema R is considered to be in Boyce–Codd normal form (BCNF) if, for every one of its dependencies A → B, one of the following conditions holds true: • A → B is a trivial functional dependency • A relation R is in BCNF if and only if: whenever there is a nontrivial FD A1, . . . , An → B1, . . . , Bm for R, it is the case that {A1, A2, ... , An} is a superkey for R. #That is, the left side of every nontrivial FD must be a superkey.
  • 14. Example (Not in BCNF): The nontrivial functional dependencies in the table are: • author → nationality • book title → genre, number of pages We can easily see that the only KEY is the set {author, book title} Author Nationality Book Title Genre Number of pages William Shakespeare English The Tempest Comedy 215 Emily Brontë Irish Wuthering Heights Gothic 540 Jeffrey Ullman American Database Systems Textbook 500 Jennifer Widom American Database Systems Textbook 500 Table 5. Author table
  • 15. Example (in BCNF): Author Nationality William Shakespeare English Emily Brontë Irish Jeffrey Ullman American Jennifer Widom American Author Book Title William Shakespeare The Tempest Emily Brontë Wuthering Heights Jeffrey Ullman Database Systems Jennifer Widom Database Systems Table 6. Author1 table Table 7. Author2 table
  • 16. Contd.. The functional dependencies for this schema are the same as before: • author → nationality • book title → genre, number of pages The key of the first table is {author}. The key of the second table is {author, book title}. The key of the third table is {book title}. There are no functional dependencies violating the BCNF rules, so the schema is in Boyce-Codd Normal Form. Book Title Genre Number of Pages The Tempest Comedy 215 Wuthering Heights Gothic 540 Database Systems Textbook 500 Table 8. Author3 table
  • 17. Advantages of Functional Dependency: • Functional Dependency removes data redundancy where the same values should not be repeated at multiple locations in the same database table. • It maintains the quality of data in the database. • FD allows clearly defined meanings and constraints of databases. • It helps in identifying bad designs of the database. • It expresses the facts about the database design.
  • 18. References H. Garcia-Molina, J. Ullman, and J.Widom. Database Systems: The Complete Book. Prentice Hall Press, second edition, 2008. [Ch. 3] https://www.guru99.com/dbms-functional-dependency.html https://www.geeksforgeeks.org/types-of-functional-dependencies-in-dbms https://www.tutorialspoint.com/Functional-dependency-in-DBMS https://www.tutorialandexample.com/functional-dependencies/