Functional Dependency

 

Functional Dependency

A Functional Dependency (FD) is a relationship between two attributes in a relational database. It describes how one attribute uniquely determines another attribute.

It is mainly used in normalization to reduce redundancy and maintain data consistency.


🔹 Definition

If attribute A determines attribute B, then we write:

A → B

This means:

  • For each value of A, there is exactly one corresponding value of B.


🔹 Example

Consider a Student table:

Roll_NoNameDepartment

Here:

Roll_No → Name
Roll_No → Department

This means Roll_No uniquely determines Name and Department.


🔹 Types of Functional Dependency

1️⃣ Trivial Functional Dependency

If B is a subset of A, then A → B is called trivial.
Example: (Roll_No, Name) → Name


2️⃣ Non-Trivial Functional Dependency

If B is not a subset of A.
Example: Roll_No → Name


3️⃣ Fully Functional Dependency

An attribute depends on the entire primary key (not part of it).


4️⃣ Partial Dependency

An attribute depends only on part of a composite key.


🔹 Importance of Functional Dependency

  • Helps in normalization

  • Reduces data redundancy

  • Maintains data integrity

  • Improves database design

Comments

Popular posts from this blog

Views in Relational Databases

SQL

EMBEDDED SQL