Function Dependancy
Function Dependancy
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.
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.
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.
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.