DBMS Functional Dependency
DBMS Functional Dependency
Functional Dependency (FD) determines the relation of one attribute to another attribute in a
database management system (DBMS) system. Functional dependency helps you to maintain the
quality of data in the database. A functional dependency is denoted by an arrow →. The
functional dependency of X on Y is represented by X → Y. Functional Dependency plays a vital
role to find the difference between good and bad database design.
Example:
In this example, if we know the value of Employee number, we can obtain Employee Name, city,
salary, etc. By this, we can say that the city, Employee Name, and salary are functionally
depended on Employee number.
Key terms
Below given are the Three most important rules for Functional Dependency:
Multivalued dependency:
Trivial functional dependency:
Non-trivial functional dependency:
Transitive dependency:
Multivalued dependency occurs in the situation where there are multiple independent
multivalued attributes in a single table. A multivalued dependency is a complete constraint
between two sets of attributes in a relation. It requires that certain tuples be present in a relation.
Example:
Car_model Maf_year Color
In this example, maf_year and color are independent of each other but dependent on car_model.
In this example, these two columns are said to be multivalue dependent on car_model.
car_model-> colour
The Trivial dependency is a set of attributes which are called a trivial if the set of attributes are
included in that attribute.
For example:
Emp_id Emp_name
AS555 Harry
AS811 George
AS999 Kevin
Functional dependency which also known as a nontrivial dependency occurs when A->B holds
true where B is not a subset of A. In a relationship, if attribute B is not a subset of attribute A,
then it is considered as a non-trivial dependency.
Example:
(Company} -> {CEO} (if we know the Company, we knows the CEO name)
But CEO is not a subset of Company, and hence it's non-trivial functional dependency.
Transitive dependency:
A transitive is a type of functional dependency which happens when t is indirectly formed by two
functional dependencies.
Example:
Alibaba Jack Ma 54
{Company} -> {CEO} (if we know the compay, we know its CEO's name)
{ Company} -> {Age} should hold, that makes sense because if we know the company name, we
can know his age.
Note: You need to remember that transitive dependency can only occur in a relation of three or
more attributes.
What is Normalization?
Normalization is a method of organizing the data in the database which helps you to avoid data
redundancy, insertion, update & deletion anomaly. It is a process of analyzing the relation
schemas based on their different functional dependencies and primary key.
Normalization is inherent to relational database theory. It may have the effect of duplicating the
same data within the database which may result in the creation of additional tables.
Functional Dependency avoids data redundancy. Therefore same data do not repeat at
multiple locations in that database
It helps you to maintain the quality of data in the database
It helps you to defined meanings and constraints of databases
It helps you to identify bad designs
It helps you to find the facts regarding the database design
Summary