0% found this document useful (0 votes)
4 views

Dependency

functional dependency
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Dependency

functional dependency
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Name:Soumili Chatterjee

Roll:PG/02/MCA/2023/025
Reg no:AU/2023/0010798
Functional Dependency in DBMS
In a relational database management, functional dependency is a concept
that specifies the relationship between two sets of attributes where one
attribute determines the value of another attribute. It is denoted as X → Y,
where the attribute set on the left side of the arrow, X is called
Determinant, and Y is called the Dependent.

Roll_no name dept_name dept_building

42 abc CO A4
43 pqr IT A3
44 xyz CO A4
45 xyz IT A3
46 mno EC B2
47 jkl ME B2
Armstrong’s axioms/properties of functional dependencies:
1.Reflexivity: If Y is a subset of X, then X→Y holds by reflexivity rule
Example, {roll_no, name} → name is valid.
2.Augmentation: If X → Y is a valid dependency, then XZ → YZ is also valid by
the augmentation rule.
Example, {roll_no, name} → dept_building is valid, hence {roll_no, name,
dept_name} → {dept_building, dept_name} is also valid.
3.Transitivity: If X → Y and Y → Z are both valid dependencies, then X→Z is
also valid by the Transitivity rule.
Example, roll_no → dept_name & dept_name → dept_building, then roll_no →
dept_building is also valid.

Types of Functional Dependencies in DBMS


Trivial functional dependency
Non-Trivial functional dependency
Multivalued functional dependency
Transitive functional dependency
1. Trivial Functional Dependency
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 trivial functional dependency
Example:
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.
2. Non-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:
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}
3. Multivalued Functional Dependency
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.
For example,
roll_no name age
42 abc 17
43 pqr 18
44 xyz 18
45 Abc 19
Here, roll_no → {name, age} is a multivalued functional dependency, since the dependents name
& age are not dependent on each other(i.e. name → age or age → name doesn’t exist !)
4. Transitive Functional Dependency
In 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.
For 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,
5. Fully 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.

6. Partial Functional Dependency

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 RBDMS.
Advantages of Functional Dependencies
1. Data Normalization
Functional dependencies play an important part in data normalization. With the help of
functional dependencies we are able to identify the primary key, candidate key in a table
which in turns helps in normalization.
2. Query Optimization
With the help of functional dependencies we are able to decide the connectivity between
the tables and the necessary attributes need to be projected to retrieve the required data
from the tables. This helps in query optimization and improves performance.
3. Consistency of Data
Functional dependencies ensures the consistency of the data by removing any
redundancies or inconsistencies that may exist in the data..
4. Data Quality Improvement
Functional dependencies ensure that the data in the database to be accurate, complete
and updated.

You might also like