Multivalued Dependency in Databases

Multivalued Dependency in Databases

Multivalued Dependency in Databases GA S REGULAR Menu Lifewire Tech for Humans Newsletter! Search Close GO Software & Apps > Apps 77 77 people found this article helpful

Multivalued Dependency in Database Design

Multivalued dependency breaks fourth normal form

By Mike Chapple Mike Chapple Writer University of Idaho Auburn University Notre Dame Former Lifewire writer Mike Chapple is an IT professional with more than 10 years' experience cybersecurity and extensive knowledge of SQL and database management. lifewire's editorial guidelines Updated on July 25, 2020 Tweet Share Email Tweet Share Email Apps Best Apps Payment Services In a relational database, a dependency occurs when the information stored in the same database table uniquely determines other information stored in the same table. A multivalued dependency occurs when the presence of one or more rows in a table implies the presence of one or more other rows in that same table. Put another way, two attributes (or columns) in a table are independent of one another, but both depend on a third attribute. stevecoleimages/Vetta/Getty Images A multivalued dependency prevents the normalization standard fourth normal form. Relational databases follow five normal forms that represent guidelines for record design. They prevent update anomalies and inconsistencies in the data. The fourth normal form deals with many-to-one relationships in a database.

Functional Dependency vs Multivalued Dependency

To understand a multivalued dependency, it is helpful to revisit what a functional dependency is. If an attribute X uniquely determines an attribute Y, then Y is functionally dependent on X. This is written as X -> Y. For example, in the Students table below, the Student_Name determines the Major: Student_Name Major Ravi Art History Beth Chemistry Students
This functional dependency can be written: Student_Name -> Major. Each Student_Name determines exactly one Major and no more. If you want the database to also track the sports these students take, you might think the easiest way to do this is to just add another column titled Sport: Student_Name Major Sport Ravi Art History Soccer Ravi Art History Volleyball Ravi Art History Tennis Beth Chemistry Tennis Beth Chemistry Soccer Students The problem here is that both Ravi and Beth play several sports. It is necessary to add a new row for every additional sport. This table has introduced a multivalued dependency because the major and the sport are independent of one another but both depend on the student. This is a simple example and easily identifiable, but a multivalue dependency could become a problem in a large, complex database. A multivalued dependency is written X ->-> Y. In this case: Student_Name ->-> Major
Student_Name ->-> Sport This is read as "Student_Name multidetermines Major" and "Student_Name multidetermines Sport." A multivalued dependency always requires at least three attributes because it consists of at least two attributes that are dependent on a third.

Multivalued Dependency and Normalization

A table with a multivalued dependency violates the normalization standard of fourth normal form because it creates unnecessary redundancies and can contribute to inconsistent data. To bring this up to 4NF, it is necessary to break this information into two tables. The table below now has a functional dependency of Student_Name -> Major, and no multivalued dependencies: Student_Name Major Ravi Art History Ravi Art History Ravi Art History Beth Chemistry Beth Chemistry Students & Majors While this table also has a single functional dependency of Student_Name -> Sport: Student_Name Sport Ravi Soccer Ravi Volleyball Ravi Tennis Beth Tennis Beth Soccer Students & Sports Normalization is often accomplished by simplifying complex tables so that they contain information related to a single idea or theme rather than trying to make a single table contain too much disparate information. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Subscribe Tell us why! Other Not enough details Hard to understand Submit More from Lifewire A Guide to Understanding Database Dependencies What Is the Primary Key in a Database? Full Functional Dependency in Database Normalization An Introduction to Databases for Beginners The Basics of Database Normalization How to Insert a Table in Microsoft Word 2013 What Is Transitive Dependency in a Database How to Use the Excel INDEX Function What Is a Cryptographic Hash Function? What Is Boyce-Codd Normal Form (BCNF)? What Is the Definition of a Database Query? Functional Dependency Definition Glossary of Common Database Terms Spreadsheets vs. Databases What is MySQL? What Is a Database Schema? Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. Cookies Settings Accept All Cookies
Share:
0 comments

Comments (0)

Leave a Comment

Minimum 10 characters required

* All fields are required. Comments are moderated before appearing.

No comments yet. Be the first to comment!