A transitive dependency in a database is an indirect relationship between values in the same table that causes a functional dependency. To achieve the normalization standard of Third Normal Form (3NF), you must eliminate any transitive dependency.

By its nature, a transitive dependency requires three or more attributes (or database columns) that have a functional dependency between them, meaning that Column A in a table relies on Column B through an intermediate Column C. Let’s see how this might work.

Transitive Dependency Example

AUTHORS

In the AUTHORS example above:

  • Book → Author: Here, the Book attribute determines the Author attribute. If you know the book name, you can learn the author’s name. However, Author doesn’t determine Book, because an author can write multiple books. For example, just because we know the author’s name is Orson Scott Card, we still don’t know the book name.Author → Author_Nationality: Likewise, the Author attribute determines the Author_Nationality, but not the other way around—just because we know the author’s nationality doesn’t mean we can determine the author.

But this table introduces a transitive dependency:

  • Book →Author_Nationality: If we know the book name, we can determine the author’s nationality via the Author column.

Avoiding Transitive Dependencies

To ensure Third Normal Form, let’s remove the transitive dependency.

We can start by removing the Book column from the Authors table and creating a separate Books table:

BOOKS

Did this fix it? Let’s examine our dependencies now:

BOOKS table:

  • Book_ID → Book: The Book depends on the Book_ID.
  • No other dependencies in this table exist, so we are okay. Note that the foreign key, Author_ID, links this table to the AUTHORS table through its primary key, Author_ID. We have created a relationship to avoid a transitive dependency, a key design of relational databases.

AUTHORS table:

  • Author_ID  → Author: The Author depends on the Author_ID.Author → Author_Nationality: The nationality can be determined by the author.Author_ID → Author_Nationality: The nationality can be determined from the Author_ID through the Author attribute. We still have a transitive dependency.

We need to add a third table to normalize this data:

COUNTRIES

Now we have three tables, making use of foreign keys to link between the tables:

  • The BOOK table’s foreign key, Author_ID, links a book to an author in the AUTHORS table.The AUTHORS table’s foreign key, Country_ID, links an author to a country in the COUNTRIES table.The COUNTRIES table has no foreign key because it has no need to link to another table in this design.

Why Transitive Dependencies Are Bad Database Design

What is the value of avoiding transitive dependencies to help ensure 3NF? Let’s consider our first table again and see the issues it creates:

This kind of design can contribute to data anomalies and inconsistencies, for example:

  • If you deleted the two books Children of the Mind and Ender’s Game, you would delete the author “Orson Scott Card” and his nationality completely from the database.You cannot add a new author to the database unless you also add a book. What if the author is yet unpublished or you don’t know the name of a book they authored?If “Orson Scott Card” changed his citizenship, you would have to change his citizenship in all records in which he appears. Having multiple records with the same author can result in inaccurate data. What if the data entry person doesn’t realize there are multiple records for someone, and changes the data in only one record?You can’t delete a book such as The Handmaid’s Tale without also completely deleting the author.

Frequently Asked Questions

  • What are the types of dependencies in a database management system? There are four types of database dependencies: trivial functional dependencies, full functional dependencies, transitive dependencies, and multivalued dependencies.
  • How does functional dependency differ from transitive dependency? In database management, dependency is a relation between two or more attributes (columns). While functional dependency is an association between two attributes of the same relation, transitive dependency occurs when an indirect relationship causes functional dependency.

Get the Latest Tech News Delivered Every Day

  • Apple’s New AI Audiobooks Are Great for Accessibility, Bad for Voice Actors

  • Glossary of Common Database Terms

  • The Basics of Database Normalization

  • Databases for Beginners

  • What Are Database Dependencies?

  • Multivalued Dependency in Database Design

  • Full Functional Dependency in Database Normalization

  • 21 Best Places to Get Free Kindle Books

  • 16 Best Places to Download Free Audiobooks

  • How to Watch the James Bond Movies in Order

  • What Is a Database Relationship?

  • One-to-Many Relationships in a Database

  • Putting a Database in Third Normal Form (3NF)

  • What Is Boyce-Codd Normal Form (BCNF)?

  • What is MySQL?

  • 18 Best Sites to Download Free Books in 2023

  • Facebook

  • Twitter

Hit Refresh on Your Tech News

  • About Us

  • Privacy Policy

  • Editorial Guidelines

  • Terms of Use

  • Careers

  • Advertise

  • Contact

  • EU Privacy

  • NEWS

  • HOW TO

  • FEATURES

  • ABOUT US