Docsity

Functional Dependencies, Exercises of Database Management Systems (DBMS)

Toggle sidebar
bg1
For
Paper: E401 (INTRODUCTION TO DATABASE MANAGEMENT SYSTEM)
Topics: Functional dependency, Types of functional dependency
Functional Dependencies
A functional dependency (FD) is a relationship between two attributes, typically between the
primary key and other non-key attributes within a table. A functional dependency denoted by
X ๏ƒ  Y , is an association between two sets of attribute X and Y. Here, X is called
the determinant, and Y is called the dependent.
For example,
SIN โ€”โ€”โ€”-> Name, Address, Birthdate
Here, SIN determines Name, Address and Birthdate.So, SIN is the determinant and Name,
Address and Birthdate are the dependents.
Rules of Functional Dependencies
1. Reflexive rule : If Y is a subset of X, then X determines Y .
2. Augmentation rule: It is also known as a partial dependency, says if X determines Y, then
XZ determines YZ for any Z
3. Transitivity rule: Transitivity says if X determines Y, and Y determines Z, then X must
also determine Z
Dependency Diagram
A dependency diagram, shown in the following figure illustrates the various dependencies that
might exist in a non-normalized table. A non-normalized table is one that has data redundancy in
it.
pf3
pf4

Partial preview of the text

Download Functional Dependencies and more Exercises Database Management Systems (DBMS) in PDF only on Docsity!

For

Paper: E401 (INTRODUCTION TO DATABASE MANAGEMENT SYSTEM) Topics: Functional dependency, Types of functional dependency

Functional Dependencies

A functional dependency (FD) is a relationship between two attributes, typically between the primary key and other non-key attributes within a table. A functional dependency denoted by

X ๏ƒ  Y , is an association between two sets of attribute X and Y. Here, X is called the determinant , and Y is called the dependent.

For example, SIN โ€”โ€”โ€”-> Name, Address, Birthdate

Here, SIN determines Name, Address and Birthdate.So, SIN is the determinant and Name, Address and Birthdate are the dependents.

Rules of Functional Dependencies

  1. Reflexive rule : If Y is a subset of X, then X determines Y.
  2. Augmentation rule: It is also known as a partial dependency, says if X determines Y, then XZ determines YZ for any Z
  3. Transitivity rule: Transitivity says if X determines Y, and Y determines Z, then X must also determine Z

Dependency Diagram

A dependency diagram, shown in the following figure illustrates the various dependencies that might exist in a non-normalized table. A non-normalized table is one that has data redundancy in it.

In this dependency diagram, the primary key is { PROJ_NUM,EMP_NUM}

Full functional dependency:

{ PROJ_NUM,EMP_NUM} ๏ƒ  HOURS

Partial functional dependency:

PROJ_NUM ๏ƒ  PROJ_NAME EMP_NUM ๏ƒ  EMP_NAME EMP_NUM ๏ƒ  JOB_CLASS EMP_NUM ๏ƒ  CHG_HOUR

Transitive dependency:

EMP_NUM ๏ƒ  JOB_CLASS (comes from EMP_NUM ๏ƒ  JOB_CLASS and JOB_CLASS ๏ƒ  CHG_HOUR)

Types of functional dependency

The following are types functional dependency in DBMS:

  1. Fully-Functional Dependency
  2. Partial Dependency
  3. Transitive Dependency
  4. Trivial Dependency
  5. Multivalued Dependency

Full functional Dependency

A functional dependency X๏ƒ Y is said to be a full functional dependency, if removal of any attribute A from X, the dependency does not hold any more. i.e. Y is fully functional dependent on X, if it is Functionally Dependent on X and not on any of the proper subset of X. For example,

{Emp_num,Proj_num} ๏ƒ  Hour

Is a full functional dependency. Here, Hour is the working time by an employee in a project.

Example: Consider the following table

Car_model Manufr_year Color

H001 2017 Metallic

H001 2017 Green

H005 2018 Metallic

H005 2018 Blue

H010 2015 Metallic

H033 2012 Gray

The functional dependencies

car_model - > manufr_year

car_model-> colour

are multivalued dependency since manufr_year and color both are multivalued attribute