![]() |
VOOZH | about |
A functional dependency occurs when one attribute uniquely determines another attribute within a relation. There are the following types of functional dependencies.
In Trivial Functional Dependency, a dependent is always a subset of the determinant. i.e., If X → Y and Y is the subset of X, then it is called a trivial functional dependency.
Symbolically: A→B is a trivial functional dependency if B is a subset of A.
The following dependencies are also trivial: A→A & B→B
Example 1 :
Example 2:
| roll_no | name | age |
|---|---|---|
| 42 | abc | 17 |
| 43 | pqr | 18 |
| 44 | xyz | 18 |
Here, {roll_no, name} → name is a trivial functional dependency, since the dependent name is a subset of determinant set {roll_no, name}. Similarly, roll_no → roll_no is also an example of trivial functional dependency.
In Non-trivial functional dependency, the dependent is strictly not a subset of the determinant. i.e. If X → Y and Y is not a subset of X, then it is called Non-trivial functional dependency.
Example 1 :
Example 2:
| roll_no | name | age |
|---|---|---|
| 42 | abc | 17 |
| 43 | pqr | 18 |
| 44 | xyz | 18 |
Here, roll_no → name is a non-trivial functional dependency, since the dependent name is not a subset of determinant roll_no. Similarly, {roll_no, name} → age is also a non-trivial functional dependency, since age is not a subset of {roll_no, name}
A semi non-trivial functional dependency occurs when part of the dependent attribute (right-hand side) is included in the determinant (left-hand side), but not all of it. This is a middle ground between trivial and non-trivial functional dependencies. X -> Y is called semi non-trivial when X intersect Y is not NULL.
Example:
Consider the following table:
| Student_ID | Course_ID | Course_Name |
|---|---|---|
| 101 | CSE101 | Computer Science |
| 102 | CSE102 | Data Structures |
| 103 | CSE101 | Computer Science |
{StudentID,CourseID}→CourseID
This is semi non-trivial because:
Course_ID) is already included in the determinant ({Student_ID, Course_ID}).In Multivalued functional dependency, entities of the dependent set are not dependent on each other. i.e. If a → {b, c} and there exists no functional dependency between b and c, then it is called a multivalued functional dependency.
Example:
| bike_model | color | accessory |
|---|---|---|
| tu1001 | Black | Helmet |
| tu1001 | Black | Gloves |
| tu1001 | Red | Helmet |
| tu1001 | Red | Gloves |
In this table:
For each bike model (bike_model):
That’s what makes it a multivalued dependency.
In this case, these two columns (color and accessory) are said to be multivalued dependent on bike_model.These dependencies can be represented like this:
bike_model →→ color
bike_model →→ accessoryIn transitive functional dependency, dependent is indirectly dependent on determinant. i.e. If a → b & b → c, then according to axiom of transitivity, a → c. This is a transitive functional dependency.
Example:
| enrol_no | name | dept | building_no |
|---|---|---|---|
| 42 | abc | CO | 4 |
| 43 | pqr | EC | 2 |
| 44 | xyz | IT | 1 |
| 45 | abc | EC | 2 |
Here, enrol_no → dept and dept → building_no. Hence, according to the axiom of transitivity, enrol_no → building_no is a valid functional dependency. This is an indirect functional dependency, hence called Transitive functional dependency.
In full functional dependency an attribute or a set of attributes uniquely determines another attribute or set of attributes. If a relation R has attributes X, Y, Z with the dependencies X->Y and X->Z which states that those dependencies are fully functional.
In partial functional dependency a non key attribute depends on a part of the composite key, rather than the whole key. If a relation R has attributes X, Y, Z where X and Y are the composite key and Z is non key attribute. Then X->Z is a partial functional dependency in RDBMS.