Functional dependency is a constraint between two sets of attributes in a relation. A functional dependency X → Y holds on a relation if, for any two tuples in the relation, whenever the values of attributes in X are the same, the values of attributes in Y are also the same. In other words, X uniquely determines Y.
Consider a STUDENT relation with attributes such as STUD_NO, STUD_NAME, STUD_PHONE, STUD_STATE, STUD_COUNTRY, STUD_AGE. From the relation we can infer functional dependencies such as:
However, STUD_NAME → STUD_ADDR need not hold if two students share the same name but live at different addresses.

Functional dependencies depend on the semantics (domain and meaning) of attributes of the relation, not merely on the data instance. Typical determinations:
The FD set of a relation is the set of all functional dependencies that hold on that relation (as determined by domain knowledge and constraints). Example FD set for the STUDENT relation above:
{ STUD_NO → STUD_NAME, STUD_NO → STUD_PHONE, STUD_NO → STUD_STATE, STUD_NO → STUD_COUNTRY, STUD_NO → STUD_AGE, STUD_STATE → STUD_COUNTRY }
Attribute closure of an attribute set X, denoted X+, is the set of all attributes that can be functionally determined from X using a given set of functional dependencies.
Procedure to compute the closure X+ given an FD set F:
Examples using the STUDENT FD set:
(STUD_NO)+ = {STUD_NO, STUD_NAME, STUD_PHONE, STUD_STATE, STUD_COUNTRY, STUD_AGE}
(STUD_STATE)+ = {STUD_STATE, STUD_COUNTRY}
Example: If (STUD_NO)+ contains all attributes of STUDENT, then STUD_NO is a super key. If no subset of STUD_NO (there is none) is a super key, it is also a candidate key. If (STUD_NO, STUD_NAME)+ also contains all attributes but STUD_NO alone already does, then (STUD_NO, STUD_NAME) is a super key but not a candidate key.
To check whether a functional dependency A → B is implied by an FD set F, compute A+ using F. If B ⊆ A+, then A → B is implied by F; otherwise it is not.
Q. Consider the relation scheme R = {E, F, G, H, I, J, K, L, M, M} and the set of functional dependencies {{E, F} → {G}, {F} → {I, J}, {E, H} → {K, L}, K → {M}, L → {N} on R. What is the key for R? (GATE-CS-2014)
(a) {E, F}
(b) {E, F, H}
(c) {E, F, H, K, L}
(d) {E}
Ans: (b)
Solution: Finding attribute closure of all given options, we get:
{E, F}+ = {E F G I J}
{E, F, H}+ = {E F H G I J K L M N}
{E, F, H, K, L}+ = {{E F H G I J K L M N}
{E}+ = {E}
{EFH}+ and {EFHKL}+ results in set of all attributes, but EFH is minimal. So it will be candidate key. So correct option is (b).
Prime attributes are attributes that are part of some candidate key of the relation. Non-prime attributes are attributes that are not part of any candidate key. Example: in the STUDENT relation, if STUD_NO is the candidate key, then STUD_NO is prime and other attributes are non-prime.
What is Functional Dependency? A functional dependency X → Y holds if two tuples having the same value for X also have the same value for Y, i.e., X uniquely determines Y.
In an EMPLOYEE relation (example attributes: E-ID, E-NAME, E-CITY, E-STATE):
The FD set for this EMPLOYEE example might be:
{ E-ID → E-NAME, E-ID → E-CITY, E-ID → E-STATE, E-CITY → E-STATE }

Table 1
A functional dependency X → Y is trivial if Y ⊆ X (that is, the right-hand side is a subset of the left-hand side). Trivial FDs always hold for any relation instance.
Example: {E-ID, E-NAME} → E-ID is trivial because {E-ID} ⊆ {E-ID, E-NAME}.
Any FD that is not trivial is called non-trivial. For example, E-ID → E-NAME is non-trivial and may hold depending on semantics.
Let X, Y and Z be attribute sets. The following properties always hold and form a sound and complete inference system for FDs.
From these axioms we can derive useful rules such as union, decomposition and pseudo-transitivity:
Given R(E-ID, E-NAME, E-CITY, E-STATE) and FDs = { E-ID → E-NAME, E-ID → E-CITY, E-ID → E-STATE, E-CITY → E-STATE }.
Compute (E-ID)+:
Add E-ID to the set: {E-ID}.
From E-ID → E-NAME add E-NAME: {E-ID, E-NAME}.
From E-ID → E-CITY add E-CITY: {E-ID, E-NAME, E-CITY}.
From E-ID → E-STATE add E-STATE: {E-ID, E-NAME, E-CITY, E-STATE}.
No further attributes can be added, so (E-ID)+ = {E-ID, E-NAME, E-CITY, E-STATE}.
Similarly:
(E-NAME)+ = {E-NAME}
(E-CITY)+ = {E-CITY, E-STATE}
Q. Find the attribute closures of given FDs R(ABCDE) = {AB → C, B → D, C → E, D → A}

Candidate key: a minimal set of attributes that functionally determines every attribute in the relation.
Super key: any set of attributes that functionally determines every attribute in the relation (not necessarily minimal).
To find candidate keys using closures:
Example for EMPLOYEE with FDs {E-ID → E-NAME, E-ID → E-CITY, E-ID → E-STATE, E-CITY → E-STATE}:
Extraneous attribute: an attribute A is extraneous in X of X → Y (with respect to FD set F) if removing A from X produces an FD that is implied by F. In that case X can be replaced by X \ {A} in the FD without changing the closure of F.
Canonical (minimal) cover of an FD set F is an equivalent set of dependencies G such that:
Algorithm to compute a canonical cover (informal):
Functional dependencies are central to decomposition and normalization. Two desirable properties of a decomposition of R into R1 and R2 are:
Q. In a schema with attributes A, B, C, D and E following set of functional dependencies are given
{A → B, A → C, CD → E, B → D, E → A}
Which of the following functional dependencies is NOT implied by the above set? (GATE IT 2005)
(a) CD → AC
(b) BD → CD
(c) BC → CD
(d) AC → BC
Ans: (b)
Solution: Using FD set given in question,
(CD)+ = {C D E A B} which means CD → AC also holds true.
(BD)+ = {B D} which means BD → CD can't hold true. So this FD is not implied in the FD set.
So (B) is the required option.
Others can be checked in the same way.
Q. Consider a relation scheme R = (A, B, C, D, E, H) on which the following functional dependencies hold: {A → B, BC → D, E → C, D → A}. What are the candidate keys of R? [GATE 2005]
(a) AE, BE
(b) AE, BE, DE
(c) AEH, BEH, BCH
(d) AEH, BEH, DEH
Ans: (d)
Solution: (AE)+ = {A B E C D} which is not set of all attributes. So AE is not a candidate key.
Hence option A and B are wrong.
(AEH)+ = {A B C D E H}
(BEH)+ = {B E H C D A}
(BCH)+ = {B C H D A} which is not set of all attributes. So BCH is not a candidate key.
Hence option C is wrong.
So correct answer is D.
Functional dependencies capture semantic constraints that define how attribute values determine other attribute values. Mastery of computing attribute closures, finding candidate and super keys, deriving implied dependencies, computing canonical covers, and understanding how FDs affect normalization and decomposition (lossless-join and dependency preservation) is essential for database design and typical exam questions. Use systematic closure computations and Armstrong's axioms when solving problems.
| 1. What is a functional dependency? | ![]() |
| 2. How are functional dependencies useful in database design? | ![]() |
| 3. What is meant by a left-hand side and right-hand side in a functional dependency? | ![]() |
| 4. How can we represent functional dependencies in a database schema? | ![]() |
| 5. What is the difference between a functional dependency and a multivalued dependency? | ![]() |
![]() | Explore Courses for Computer Science Engineering (CSE) exam |
![]() | Get EduRev Notes directly in your Google search |