Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Aptitude
  • Engineering Mathematics
  • Discrete Mathematics
  • Operating System
  • DBMS
  • Computer Networks
  • Digital Logic and Design
  • C Programming
  • Data Structures
  • Algorithms
  • Theory of Computation
  • Compiler Design
  • Computer Org and Architecture
Open In App
Next Article:
Canonical Cover of Functional Dependencies in DBMS
Next article icon

Types of Functional dependencies in DBMS

Last Updated : 16 Jan, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

In relational database management, functional dependency is a concept that specifies the relationship between two sets of attributes where one attribute determines the value of another attribute. It is denoted as X → Y, where the attribute set on the left side of the arrow, X is called Determinant, and Y is called the Dependent. 

What is Functional Dependency?

A functional dependency occurs when one attribute uniquely determines another attribute within a relation. It is a constraint that describes how attributes in a table relate to each other. If attribute A functionally determines attribute B we write this as the A→B.

Functional dependencies are used to mathematically express relations among database entities and are very important to understanding advanced concepts in Relational Database Systems.

Example:

roll_no name dept_name dept_building
42 abc CO A4
43 pqr IT A3
44 xyz CO A4
45  xyz IT A3
46 mno EC B2
47 jkl ME B2

From the above table we can conclude some valid functional dependencies:

  • roll_no → { name, dept_name, dept_building }→  Here, roll_no can determine values of fields name, dept_name and dept_building, hence a valid Functional dependency
  • roll_no → dept_name , Since, roll_no can determine whole set of {name, dept_name, dept_building}, it can determine its subset dept_name also.
  • dept_name → dept_building ,  Dept_name can identify the dept_building accurately, since departments with different dept_name will also have a different dept_building
  • More valid functional dependencies: roll_no → name, {roll_no, name} ⇢ {dept_name, dept_building}, etc.

Here are some invalid functional dependencies:

  • name → dept_name   Students with the same name can have different dept_name, hence this is not a valid functional dependency.
  • dept_building → dept_name    There can be multiple departments in the same building. Example, in the above table departments ME and EC are in the same building B2, hence dept_building → dept_name is an invalid functional dependency.
  • More invalid functional dependencies: name → roll_no, {name, dept_name} → roll_no, dept_building → roll_no, etc.

Read more about What is Functional Dependency in DBMS ?

Types of Functional Dependencies in DBMS

  1. Trivial functional dependency
  2. Non-Trivial functional dependency
  3. Multivalued functional dependency
  4. Transitive functional dependency

1. Trivial Functional Dependency

In Trivial Functional Dependency, a dependent is always a subset of the determinant. i.e. If X → Y and Y is the subset of X, then it is called trivial functional dependency.

Symbolically: A→B is trivial functional dependency if B is a subset of A.

The following dependencies are also trivial: A→A & B→B

Example 1 :

  • ABC -> AB
  • ABC -> A
  • ABC -> ABC

Example 2:

roll_no name age
42 abc 17
43 pqr 18
44 xyz 18

Here, {roll_no, name} → name is a trivial functional dependency, since the dependent name is a subset of determinant set {roll_no, name}. Similarly, roll_no → roll_no is also an example of trivial functional dependency. 

2. Non-trivial Functional Dependency

In Non-trivial functional dependency, the dependent is strictly not a subset of the determinant. i.e. If X → Y and Y is not a subset of X, then it is called Non-trivial functional dependency.

Example 1 :

  • Id -> Name
  • Name -> DOB

Example 2:

roll_no name age
42 abc 17
43 pqr 18
44 xyz 18

Here, roll_no → name is a non-trivial functional dependency, since the dependent name is not a subset of determinant roll_no. Similarly, {roll_no, name} → age is also a non-trivial functional dependency, since age is not a subset of {roll_no, name} 

3. Semi Non Trivial Functional Dependencies 

A semi non-trivial functional dependency occurs when part of the dependent attribute (right-hand side) is included in the determinant (left-hand side), but not all of it. This is a middle ground between trivial and non-trivial functional dependencies. X -> Y is called semi non-trivial when X intersect Y is not NULL. 

Example:

Consider the following table:

Student_ID Course_ID Course_Name
101 CSE101 Computer Science
102 CSE102 Data Structures
103 CSE101 Computer Science

Functional Dependency:

{StudentID,CourseID}→CourseID

This is semi non-trivial because:

  • Part of the dependent attribute (Course_ID) is already included in the determinant ({Student_ID, Course_ID}).
  • However, the dependency is not completely trivial because {StudentID}→CourseID is not implied directly.

4. Multivalued Functional Dependency

In Multivalued functional dependency, entities of the dependent set are not dependent on each other. i.e. If a → {b, c} and there exists no functional dependency between b and c, then it is called a multivalued functional dependency.

Example:

bike_model

manuf_year

color

tu1001

2007

Black

tu1001

2007

Red

tu2012

2008

Black

tu2012

2008

Red

tu2222

2009

Black

tu2222

2009

Red

In this table:

  • X: bike_model
  • Y: color
  • Z: manuf_year

For each bike model (bike_model):

  1. There is a group of colors (color) and a group of manufacturing years (manuf_year).
  2. The colors do not depend on the manufacturing year, and the manufacturing year does not depend on the colors. They are independent.
  3. The sets of color and manuf_year are linked only to bike_model.

That’s what makes it a multivalued dependency.

In this case these two columns are said to be multivalued dependent on bike_model. These dependencies can be represented like this:

Read more about Multivalued Dependency in DBMS.

5. Transitive Functional Dependency

In transitive functional dependency, dependent is indirectly dependent on determinant. i.e. If a → b & b → c, then according to axiom of transitivity, a → c. This is a transitive functional dependency.

Example:

enrol_no name dept building_no
42 abc CO 4
43 pqr EC 2
44 xyz IT 1
45 abc EC 2

Here, enrol_no → dept and dept → building_no. Hence, according to the axiom of transitivity, enrol_no → building_no is a valid functional dependency. This is an indirect functional dependency, hence called Transitive functional dependency.

6. Fully Functional Dependency

In full functional dependency an attribute or a set of attributes uniquely determines another attribute or set of attributes. If a relation R has attributes X, Y, Z with the dependencies X->Y and X->Z which states that those dependencies are fully functional.

Read more about Fully Functional Dependency.

7. Partial Functional Dependency

In partial functional dependency a non key attribute depends on a part of the composite key, rather than the whole key. If a relation R has attributes X, Y, Z where X and Y are the composite key and Z is non key attribute. Then X->Z is a partial functional dependency in RBDMS.

Read more about Partial Dependency.

Conclusion

Functional dependency is very important concept in database management system for ensuring the data consistency and accuracy. In this article we have discuss what is the concept behind functional dependencies and why they are important. The valid and invalid functional dependencies and the types of most important functional dependencies in RDBMS. We have also discussed about the advantages of FDs. 

For more details you can refer Database Normalization and Difference between Fully and Partial Functional Dependency articles. 



Next Article
Canonical Cover of Functional Dependencies in DBMS
author
omkarphansopkar
Improve
Article Tags :
  • DBMS
  • GATE CS
  • Technical Scripter
  • dbms
  • Technical Scripter 2020

Similar Reads

  • What is Functional Dependency in DBMS?
    Functional dependency in DBMS is an important concept that describes the relationship between attributes (columns) in a table. It shows that the value of one attribute determines the other. In this article, we will learn about functional dependencies and their types. Functional dependencies help mai
    5 min read
  • Canonical Cover of Functional Dependencies in DBMS
    Managing a large set of functional dependencies can result in unnecessary computational overhead. This is where the canonical cover becomes useful. The canonical cover of a set of functional dependencies F is a simplified version of F that retains the same closure as the original set, ensuring no re
    8 min read
  • Fully Functional Dependency in DBMS
    In the case of database management systems (DBMS), knowledge of dependencies is vital for the base built on this and it is a must for the development of the database that is most useful and practical. Special interdependency, which is expressed in the schema of the database, is based on the rule of
    4 min read
  • Join Dependencies in DBMS
    Join Dependency (JD) can be illustrated as when the relation R is equal to the join of the sub-relations R1, R2,..., and Rn are present in the database. Join Dependency arises when the attributes in one relation are dependent on attributes in another relation, which means certain rows will exist in
    5 min read
  • Armstrong's Axioms in Functional Dependency in DBMS
    Armstrong's Axioms refer to a set of inference rules, introduced by William W. Armstrong, that are used to test the logical implication of functional dependencies. Given a set of functional dependencies F, the closure of F (denoted as F+) is the set of all functional dependencies logically implied b
    5 min read
  • Equivalence of Functional Dependencies
    Pre-Requisite: Functional Dependency, Finding Attribute Closure, and Candidate Keys using Functional Dependency For understanding the equivalence of Functional Dependencies Sets (FD sets), the basic idea about Attribute Closure is given in this article Given a Relation with different FD sets for tha
    5 min read
  • Allowed Functional Dependencies (FD) in Various Normal Forms (NF)
    Prerequisite - Functional Dependency and Attribute Closure We all know the following: 2 NF does not allow partial dependency.3NF does not allow transitive dependency.BCNF does not allow anything other than super key as determinant. Let’s check all possible functional dependencies to find out what is
    2 min read
  • Finding Additional functional dependencies in a relation
    A functional dependency is simply a constraint between two sets of attributes from the database. A functional dependency is used in normalization. A functional dependency is denoted by an arrow → .The functional dependency of A on B is represented by A → B. Functional Dependency plays a
    4 min read
  • Partial, Full, and Transitive Dependencies
    Functional Dependency is a key feature of a Database management System. Functional Dependency is used to maintain the relationship between various attributes in a given database. What is Functional Dependency?Functional dependency states the relationship between two sets of attributes where a value
    6 min read
  • Partial Dependency in DBMS
    Databases are structured to handle cases where some data relies on only part of a key, not the whole key. In this case we can say data is partially dependent. Partial dependency is similar to a functional or strong dependency, as it shows a constrained relationship between two or more attributes in
    6 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences