Types of Functional Dependency with Example

Types of Functional Dependency with Example –  Various Types of Functional Dependencies are –

  • Single Valued Functional Dependency
  • Fully Functional Dependency
  • Partial Functional Dependency
  • Transitive Functional Dependency
  • Trivial Functional Dependency
  • Non Trivial Functional Dependency
    • Complete Non Trivial Functional Dependency
    • Semi Non Trivial Functional Dependency

Single Valued Functional Dependency –

Database is a collection of related information in which one information depends on another information. The information is either single-valued or multi-valued. For example, the name of the person or his.her date of birth are single valued facts. But the qualification of a person is a multivalued facts. A simple example of single value functional dependency is when A is the primary key of an entity (eg. SID) and B is some single valued attribute of the entity (eg. Sname). Then, A → B must always hold.
CID SID Sname
C1 S1 A
C1 S2 A
C2 S1 A
C3 S1 A
SID → Sname                  Sname → SID    X
S1     A                      A      S1
S1     A                      A      S2
S1     A                      
For every SID, there should be unique name (X → Y) Definition : Let R be the relational schema and X, Y be the set of attributes over R. t1, t2 be the any tuples of R. X → Y exists in relation R only if t1.X = t2.X then t1.Y = t2.Y If condition fails – then dependency is not there.

Fully Functional Dependency –

A functional dependency P → Q is full functional dependency if removal of any attribute A from P means that the dependency does not hold any more. or In a relation R, an attribute Q is said to be fully functional dependent on attribute P, if it is functionally dependent on P and not functionally dependent on any proper subset of P. The dependency P → Q is left reduced, their being no extraneous attributes in the left hand side of the dependency. If AD → C, is fully functional dependency, then we cannot remove A or D. i.e. C is fully functional dependent on AD. If we are able to remove A or D, then it is not full functional dependency. Another Example, Consider the following Company Relational Schema,
 Company relational schema -Types of Functional Dependency with Example
FIG 1
{SSN, PNUMBER} → HOURS is a full FD since neither SSN → HOURS
                 nor PNUMBER → HOURS hold

{SSN, PNUMBER} → ENAME is not  a full FD (it is called a partial
                 dependency ) since SSN → ENAME also holds

Partial Functional Dependency – 

A Functional Dependency in which one or more non key attributes are functionally depending on a part of the primary key is called partial functional dependency. or where the determinant consists of key attributes, but not the entire primary key, and the determined consist of non-key attributes.
For example, Consider a Relation R(A,B,C,D,E) having
FD : AB → CDE where PK is AB.

Then, { A → C; A → D; A → E; B → C; B → D; B → E }
        all are Partial Dependencies.

Transitive Dependency –

Given a relation R(A,B,C)  then dependency like A–>B, B–>C   is a transitive dependency, since   A–>C is implied .

In the above Fig 1,
SSN --> DMGRSSN is a transitive FD
                {since SSN --> DNUMBER and DNUMBER --> DMGRSSN hold}

SSN --> ENAME is non-transitive FD since there is no set of attributes X
                where SSN --> X and X --> ENAME.
CLICK To Know – Trivial, Semi-Non Trivial, Complete Non-Trivial Functional Dependency

]]>

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top