Functional Dependency in DBMS

Functional Dependency

The relationship existing between any two attributes is called functional dependency. This kind of relationship is present between the non-key attribute and the primary key inside a table. Functional dependencies come in use for designing or redesign of a relational database which assists to remove redundancy (duplication of data), thus minimizing the chance of update anomalies. Redundancy is removed via a process called normalization.

xày

In the above illustrated Functional Dependency, x will be known as the determinant and y will be known as the dependent.

For Example

Let us imagine that there is a table where employee data is the key attributes are: Emp_Name, Emp_ID, Emp_Address.

Here Emp_Name attribute can individually identify the Emp_Id attribute of the given table. The reason behind this identification is that if one is aware of the Emp_Name then we can identify the employee ID linked with it.

This Functional Dependency can be illustrated as:

Emp_NameàEmp_Id

The above illustration implies that Emp_Id is functionally dependant on Emp_Name.

 

Different types of Functional Dependency

  1. Trivial Functional Dependency
  2. Non Trivial Functional Dependency

 

Trivial functional Dependency

  • xày will have trivial functional dependency if y is a subset of x.
  • Following are also Trivial Dependencies: aày, yày

Example

Let us assume there is a table that has two columns Emp_Name and Emp_Id.

{Emp_Name,Emp_Id}àEmp _Name is a trivial functional dependency because Emp_Name is a subset of {Emp_Name.Emp_Id}. Similarly, Emp_NameàEmp_Name and Emp_IdàEmp_ID also have trivial functional dependencies.

 

Non Trivial Functional Dependency

  • xày have Non-Trivial Functional dependency if y is not a subset of x.
  • When x intersection y is NULL, then xày is known as complete non- trivial.

Example

  1. NameàID
  2. IDàDOB