Functional Dependency (FD) is one of the most important concepts in Database Management Systems (DBMS). It forms the foundation of normalization and helps in designing a well-structured relational database.
In simple terms, a Functional Dependency describes a relationship between attributes in a relation (table), where the value of one attribute determines the value of another attribute.
Understanding functional dependencies is essential because they help:
identify keys
remove redundancy
avoid anomalies
design normalized databases
What is Functional Dependency?
A Functional Dependency is a constraint between two sets of attributes in a relation.
It is represented as:
X → Y
This means:
If two rows in a table have the same value for attribute set X, then they must also have the same value for attribute set Y.
Here:
X is called the determinant
Y is called the dependent attribute
In other words, X functionally determines Y.
Understanding Functional Dependency with an Example
Consider the following STUDENT table:
| Roll_No | Name | Department | |
|---|---|---|---|
| 101 | Aditi | CSE | aditi@xyz.com |
| 102 | Rahul | ECE | rahul@xyz.com |
| 103 | Meera | CSE | meera@xyz.com |
From this table, we can observe:
Roll_No → Name
Roll_No → Department
Roll_No → Email
This is because each Roll_No uniquely identifies one student.
If two rows have the same Roll_No, then:
the Name must also be the same
the Department must also be the same
the Email must also be the same
Therefore, Roll_No functionally determines the other attributes.
Determinant and Dependent Attribute
In a functional dependency:
X → Y
X is called the determinant
Y is called the dependent attribute
Example:
Roll_No → Name
Here:
Roll_No is the determinant
Name is the dependent attribute
The determinant is responsible for uniquely identifying the dependent attribute.
Functional Dependency with Multiple Attributes
Sometimes, a combination of attributes determines another attribute.
Example:
(Student_ID, Course_ID) → Grade
This means:
a student's grade depends on both Student_ID and Course_ID together
Neither Student_ID alone nor Course_ID alone can uniquely determine Grade.
This type of dependency uses a composite determinant.
Types of Functional Dependencies
1. Trivial Functional Dependency
A functional dependency is called trivial if the dependent attribute is already a subset of the determinant.
Formally:
If Y ⊆ X, then X → Y is trivial
Example:
(A, B) → A
Here:
A is already part of (A, B)
Therefore, the dependency is trivial.
Trivial dependencies always hold true.
2. Non-Trivial Functional Dependency
A functional dependency is non-trivial if the dependent attribute is not a subset of the determinant.
Example:
Roll_No → Name
Here:
Name is not part of Roll_No
Therefore, it is a non-trivial functional dependency.
Most meaningful dependencies in database design are non-trivial.
3. Completely Non-Trivial Functional Dependency
A functional dependency is completely non-trivial if:
X and Y have no common attributes
Example:
Roll_No → Department
Here:
Roll_No and Department are completely different attributes
So, the dependency is completely non-trivial.
Functional Dependency and Keys
Functional Dependency is closely related to keys in relational databases.
If an attribute or a set of attributes functionally determines all other attributes in a relation, then it can act as a candidate key.
Example:
Roll_No → Name
Roll_No → Department
Roll_No → Email
Since Roll_No determines all other attributes, Roll_No becomes a candidate key.
Important idea:
every key creates functional dependencies
but not every functional dependency forms a key
Real-World Examples of Functional Dependency
Functional dependencies appear naturally in real-world systems.
Examples:
Employee_ID → Employee_Name
Aadhaar_Number → Person_Name
ISBN → Book_Title
Vehicle_Number → Owner_Name
In all these examples:
the left-side attribute uniquely determines the right-side attribute
Why Functional Dependency is Important?
Functional Dependency is important because it helps in:
identifying candidate keys
finding primary keys
reducing redundancy
avoiding insertion, deletion, and update anomalies
normalization of relations
improving data consistency
designing efficient relational schemas
Without understanding functional dependencies, normalization cannot be properly understood.
How to Identify Functional Dependencies?
To identify functional dependencies in a table:
Look for attributes that uniquely identify other attributes.
Understand real-world business rules.
Ask the question:
If two rows have the same value of X, must they always have the same value of Y?
If the answer is yes, then:
X → Y
exists.
Functional Dependency vs Relation Instance
Functional dependencies are based on the semantics or meaning of the data, not just the current rows present in the table.
For example:
even if current data accidentally contains duplicate emails
the business rule may still require:
Email → User
So FDs are logical constraints, not temporary observations.
Important Points to Remember
Functional Dependency describes a relationship between attributes.
It is written as:
X → Y
X is the determinant.
Y is the dependent attribute.
Functional dependencies help identify keys.
They are essential for normalization and relational design.
Composite determinants may contain multiple attributes.
Functional dependencies reduce redundancy and anomalies.
Summary
Functional Dependency in DBMS is a relationship between attributes where one attribute (or set of attributes) determines another attribute. It is represented as X → Y, where X is called the determinant and Y is called the dependent attribute. Functional dependencies are fundamental to relational database design because they help identify keys, reduce redundancy, support normalization, and maintain data consistency. Understanding functional dependency is essential for learning normalization, candidate keys, and advanced relational database concepts.