Types of Functional Dependencies


Types of Functional Dependencies

There are mainly three types of functional dependencies:
1. Trivial Functional Dependency
2. Non-Trivial Functional Dependency
3. Transitive Dependency

1. Trivial Functional Dependency

The trivial dependency is a set of attributes, that can be called as trivial if and only if, the set of attributes are included in that attribute.

So X -> Y is a trivial functional dependency if Y 
X.

For example, let us consider the relation student having roll_no and stud_name fields. 

{Roll_no,stud_name} -> Roll_no is a trivial functional dependency as 

Roll_no 
 {Roll_no,stud_name}

2. Non- Trivial Functional Dependency

The functional dependency in which X -> Y holds true,  where Y is not a subset of X.

So in a relationship, if attribute Y is not a subset of attribute X, then it is considered as a non-trivial dependency.

X -> Y, is a non-trivial functional dependency if  Y  X.

eg. Let us consider the relation student having roll_no and stud_name fields. 

Roll_no -> Stud_name is a non-trivial functional dependency.

3. Transitive Dependency

An indirect relationship, which causes functional dependency is called transitive dependency.

A transitive dependency can be formed if there are at least three or more attributes, within the database and they should be functionally dependent on each other.

Let us consider the below given relation of Student with the following functional dependencies:
Roll_No -> {Dept_no}
Dept_no -> {Dept_name}

So, as per the rule of transitivity, {Roll_No} -> {Dept_name} holds.


Comments

Popular posts from this blog

Transaction State Diagram

Closure of Attributes

Functional Dependency