0% found this document useful (0 votes)
37 views19 pages

DBDM - Functional Dependency

Functional dependency (FD) is a database constraint that defines the relationship between attributes, primarily between primary keys and non-prime attributes, helping maintain data quality. There are various types of functional dependencies including trivial, non-trivial, multivalued, and transitive, each serving different purposes in data management. The advantages of functional dependencies include ensuring data integrity, facilitating normalization, optimizing storage, and simplifying maintenance of database schemas.

Uploaded by

aaseemabu
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)
37 views19 pages

DBDM - Functional Dependency

Functional dependency (FD) is a database constraint that defines the relationship between attributes, primarily between primary keys and non-prime attributes, helping maintain data quality. There are various types of functional dependencies including trivial, non-trivial, multivalued, and transitive, each serving different purposes in data management. The advantages of functional dependencies include ensuring data integrity, facilitating normalization, optimizing storage, and simplifying maintenance of database schemas.

Uploaded by

aaseemabu
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

Functional Dependency

Functional Dependency
• A dependency function (FD) is a database
constraint that determines the relationship of one
attribute to another in a database management
system (DBMS). Functional dependencies help
maintain the quality of data in the database.
Functional dependence is a relationship that exists
between two attributes. It usually exists between
the primary key and non-prime attributes in the
table.
• Example: X -> Y
• How to represent functional dependency in DBMS?
• Functional dependency is expressed in the form of
equations. Here you have an array of objects (A, B, C,
etc.) and an arrow (->) that represents the
dependency. For example, if we have an employee
record with fields “EmployeeID”, “FirstName” and
“LastName”, we can specify the function as follows:
• EmployeeID -> FirstName, LastName
• To represent functional dependency in DBMS has two
main features: left (LHS) and right (RHS) of the arrow
(->).
Types of Functionality in DBMS
• Trivial Functional Dependency
• Non-trivial Functional Dependency
• Multivalued Functional Dependency
• Transitive Functional Dependency
Types of Functionality in DBMS
• Trivial Functional Dependency
• Trivial functional dependency occurs when an
attribute or attributes (columns) appear in the
DBMS. When the (->) function is present, the left
element (LHS) already determines the right
element (RHS) without additional information.
• Example: Suppose we have a student table with
attributes “EmployeeID” and “EmployeeName”. In
this case, if we declare the dependency function
as
• EmployeeID -> EmployeeName
• Non-trivial Functional Dependency
• Non-trivial functional dependencies are a type of
dependency between attributes (columns) in a
table. Here the relationship is neither obvious nor
important. It provides valuable information about
how values in one feature set determine
values in another feature set.
• Example: Here is the functional dependency
based on the employee’s date of birth
(EmployeeDOB) and Department. In this case the
non-trivial dependency will be
EmployeeId EmployeeName Employee DOB Department

1001 Alice 1995-05-25 A

1002 Bob 1996-07-16 B

1003 Cavin 1999-09-17 A


1004
Denil
1999-03-12
B
• EmployeeId
• EmployeeName
• EmployeeDOB
• Department
• 1001
• Alice
• 1995-05-25
• A
• 1002
• Bob
• 1996-07-16
• B
• 1003
• Cavin
• 1999-09-17
• A
• 1004
• Denil
• 1999-03-12
• B
Multivalued Functional Dependency
• Multivalued functional dependencies in a
database occur when one or more attributes
determine multiple independent values in
other attributes. Indicates that changes in the
defined attributes will lead to various
combinations of values in the attributes that
specify the relationship in the data.
• Example:
StudentId StudentName Course

101 Ali {Math, English}

102 Bob {History, English}

103 Cavin {Physics, Hindi}


• In the above case, the multivalued
dependency holds as:
• Ali has StudentID 101 and enrolled in {Math,
English}.
• Bob has StudentID 102 and enrolled in
{History, English}.
• Cavin has StudentID 103 and enrolled in
{Physics, Hindi}.
• Transitive Functional Dependency
• Transitive functional dependency in DBMS is the relationship between
attributes (columns) of a database table. This occurs when the price of one
property determines the price of another property through an
intermediate (third) factor.
• Example: Consider a database table named “Employee_Info” with the
following properties:
• Empoyee_ID (a unique identifier for each student),
• Employee_Name,
• Employee_Address
• Employee_City.
• In this example we can assume that Employee_Address is linked to
Employee_City and Employee_City is linked to Employee_ID. This creates a
transitive dependency in the DBMS where Employee_ID directly
determines Employee_Address.
Advantages of functional dependency
• Data Integrity: Working effectively helps ensure the integrity of the
information in the database. By defining rules that govern the
relationships between attributes, the DBMS can enforce constraints that
prevent incorrect or erroneous data from being entered into the database.
• Normalization: Functional dependencies are used for database
normalization. By identifying and using dependencies, data designers can
split large tables into smaller, more manageable tables, thus reducing data
duplication and anomalies.
• Effective Storage: Normalization can create more data storage space.
Small tables require less storage space. This is especially useful for large
files.
• Easy to maintain: Repositories that keep track of functional dependencies
are easy to maintain. When the warehouse model or schema needs to be
changed, the impact of these changes occurs in many places, reducing the
risk of reporting errors or inconsistencies in the warehouse.

You might also like