0% found this document useful (0 votes)
26 views4 pages

12.multi-Valued Dependencies and Fourth Normal Form

12.Multi-valued Dependencies and Fourth Normal Form

Uploaded by

9047007778
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views4 pages

12.multi-Valued Dependencies and Fourth Normal Form

12.Multi-valued Dependencies and Fourth Normal Form

Uploaded by

9047007778
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Fourth Normal Form (4NF)

A table is said to be in the Fourth Normal Form when,

1. It is in the Boyce-Codd Normal Form.


2. And, it doesn't have Multi-Valued Dependency.

Rules for 4th Normal Form

For a table to satisfy the Fourth Normal Form, it should satisfy the
following two conditions:

1. It should be in the Boyce-Codd Normal Form.


2. And, the table should not have any Multi-valued Dependency.
Let's try to understand what multi-valued dependency

What is Multi-valued Dependency?

A table is said to have multi-valued dependency, if the following


conditions are true,

1. For a dependency A → B, if for a single value of A, multiple value of


B exists, then the table may have multi-valued dependency.
2. Also, a table should have at-least 3 columns for it to have a multi-
valued dependency.
3. And, for a relation R(A,B,C), if there is a multi-valued dependency
between, A and B, then B and C should be independent of each
other.
If all these conditions are true for any relation(table), it is said to have
multi-valued dependency.

Example

Below we have a college enrolment table with


columns s_id, course and hobby.
s_id course hobby

1 Science Cricket

1 Maths Hockey

2 C# Cricket

2 Php Hockey

As you can see in the table above, student with s_id 1 has opted for two
courses, Science and Maths, and has two hobbies, Cricket and Hockey.

You must be thinking what problem this can lead to, right?

Well the two records for student with s_id 1, will give rise to two more
records, as shown below, because for one student, two hobbies exists,
hence along with both the courses, these hobbies should be specified.

s_id course hobby

1 Science Cricket

1 Maths Hockey

1 Science Hockey
1 Maths Cricket

And, in the table above, there is no relationship between the


columns course and hobby. They are independent of each other.

So there is multi-value dependency, which leads to un-necessary


repetition of data and other anomalies as well.

How to satisfy 4th Normal Form?

To make the above relation satify the 4th normal form, we can
decompose the table into 2 tables.

CourseOpted Table

s_id course

1 Science

1 Maths

2 C#

2 Php

And, Hobbies Table,

s_id hobby
1 Cricket

1 Hockey

2 Cricket

2 Hockey

Now this relation satisfies the fourth normal form.

A table can also have functional dependency along with multi-valued


dependency. In that case, the functionally dependent columns are moved
in a separate table and the multi-valued dependent columns are moved
to separate tables.

If you design your database carefully, you can easily avoid these issues.

You might also like