Open In App

Partial, Full, and Transitive Dependencies

Functional Dependency is a key feature of a Database management System. Functional Dependency is used to maintain the relationship between various attributes in a given database.

What is Functional Dependency?

Functional dependency states the relationship between two sets of attributes where a value of a set of attributes is dependent on the other set of attributes.



It is a relationship that typically exists between two attributes such that with the help of one attribute we can get the values of another attribute. The attribute that is used for finding the values of other attributes is called the primary key attribute.

Why is Functional Dependency Used?

Example

We have a table with student details such as roll number, name, and city.



roll_no

name

city

1

Yash

Delhi

2

Kartik

Mumbai

3

Aditya

Delhi

4

Kartik

Pune

Types of Dependencies

Partial Dependency

Example

Let’s take an example, we have a table where we have columns of student roll number, subject ID, sub name, and marks obtained.

Table

roll_no

sub_id

sub_name

sub_mark

1

121

Science

80

1

131

Math

65

2

131

Math

95

2

141

English

75

Full Dependency

Example

Let’s take an example, we have a table where we have columns of student roll number, subject ID, and marks obtained.

Table

roll_no

sub_id

marks

1

121

80

1

131

65

2

131

95

2

141

75

Transitive Dependency

Example

Let’s take an example, we have a table where we have columns of student roll number, name, city where student live, and zip-code of city .

Table

roll_no

name

city

zip-code

1

abc

pune

411044

2

jkl

mumbai

400001

3

uvw

pune

411044

4

xyz

delhi

110001

Partial, Full, and Transitive Dependency – FAQs

Which normal form is based on partial dependency?

2NF(second normal form ) is used to eliminate the partial dependencies present in the database.

Which normal form is based on transitive dependency?

3NF(third normal form ) is used to eiminate the transitives dependencies present in database.

Why are partial and transitive dependencies are bad?

Because they create problems in database management. Due to this type of dependency, they create redundancy issue , inconsistency in data and many more issues.So we need to avoid this type of dependencies .

How to avoid transitive dependency?

To avoid transitive dependency, a new table should be created using the non prime attributes which have relation with each other .New table should have its primary key and a refernce to the previous table via foreign key.

How to avoid transitive dependency?

The partial primary key attribute with its dependent attribute is removed from the table and kept in a new table with new relation where non prime attribute are now fully dependent on primary key atrributes.


Article Tags :