0% found this document useful (0 votes)
38 views6 pages

Function Dependancy

Function depends

Uploaded by

mentordiv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views6 pages

Function Dependancy

Function depends

Uploaded by

mentordiv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Functional dependencies in DBMS

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.

Functional dependencies are used to mathematically express relations among


database entities and are very important to understand advanced concepts in
Relational Database System and understanding problems in competitive exams like
Gate.

Example:
From the above table we can conclude some valid functional dependencies:
roll_no → { name, dept_name, dept_building },→ Here, roll_no can determine
values of fields name, dept_name and dept_building, hence a valid Functional
dependency
roll_no → dept_name , Since, roll_no can determine whole set of {name,
dept_name, dept_building}, it can determine its subset dept_name also.
dept_name → dept_building , Dept_name can identify the dept_building
accurately, since departments with different dept_name will also have a different
dept_building
More valid functional dependencies: roll_no → name, {roll_no, name} ⇢
{dept_name, dept_building}, etc.

Here are some invalid functional dependencies:


name → dept_name Students with the same name can have different dept_name,
hence this is not a valid functional dependency.
dept_building → dept_name There can be multiple departments in the same
building. Example, in the above table departments ME and EC are in the same
building B2, hence dept_building → dept_name is an invalid functional
dependency.
More invalid functional dependencies: name → roll_no, {name, dept_name} →
roll_no, dept_building → roll_no, etc.

Types of Functional Dependencies in DBMS


1 Trivial functional dependency
2 Non-Trivial functional dependency
3 Multivalued functional dependency
4 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:

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.

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,

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,

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.

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
Functional dependencies having numerous applications in the field of database
management system. Here are some applications listed below:

1. Data Normalization
Data normalization is the process of organizing data in a database in order to
minimize redundancy and increase data integrity. 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. Functional dependency
ensures that the changes made in one attribute does not affect inconsistency in
another set of attributes thus it maintains the consistency of the data in database.

4. Data Quality Improvement


Functional dependencies ensure that the data in the database to be accurate,
complete and updated. This helps to improve the overall quality of the data, as well
as it eliminates errors and inaccuracies that might occur during data analysis and
decision making, thus functional dependency helps in improving the quality of data
in database.

You might also like