##### Quick Contact

##### DBMS Tutorial

- DBMS Tutorial
- What is Database Management System (DBMS)?
- Components of DBMS
- Applications of DBMS
- Three Schema DBMS Architecture
- Difference between DBMS and RDBMS?
- Difference between File Oriented System and DBMS
- Types of Data Models
- DBMS Schema and Instances
- Data Independence and Data Abstraction
- Database Users and Administrator
- DBMS Languages and Interfaces

##### DBMS ER Model

##### DBMS Relational Data Model

##### DBMS Normalization

#### Fourth Normal Form (4NF)

A relation R is in DBMS Fourth Normal Form 4NF only if a multi-valued dependency exists in R, say A →→ B. In this case, all attributes of R are functionally dependent on A.

For a dependency **P → Q,** if for an individual value of **P,** multiple value of **Q** exist, then the relationship would be a multi-valued dependency.

##### Example

Consider the relation STUDENT (SID, SUBJECT, ACTIVITY) participate in attributes. Assume that students can enroll in several different subjects and several different activities. Since this is so, the only key is the combination of (SID, SUBJECT, and ACTIVITY).

##### STUDENT

SID | SUBJECT | ACTIVITY |
---|---|---|

200 | Music | Swimming |

200 | Accounting | Swimming |

200 | Music | Tennis |

200 | Accounting | Tennis |

250 | Math | Jogging |

Students 200 subjects in music and accounting. He/She also participates in swimming and tennis. Student 250 subject only in math and particularly in jogging. The relation student has a multivalued dependency. **Multivalued dependencies** generate to update anomalies.

Student 200 has four rows. Each one shows one of his subjects paired with one of these activities. If the data were stored any other way, we had only two rows: one for music and swimming and one for accounting and tennis, then the implications would be misleading.

It would appear that student 100 swam only when he was a music subject and played tennis only as an accounting subject. That interpretation is illogical! These subjects and activities are entirely independent of one another. So, in this relation, we store all the combinations of subjects and activities. But data redundancy is not an essential problem with multivalued dependencies.

Suppose that student 200 decides to sign up for skiing, so we add the row [200, Music, Skiing]. This implies that skies as a music subject, but not as an accounting subject. To keep consistent, we must add one row for each of these subjects paired with skiing. Thus we must also add the row [100, Accounting, Skiing]. This is an update anomaly.

In general, multivalued dependencies exist when there at least three attributes in a relation. At least one of them is multivalued, and the values of two attributes depend only on the other attributes.

In other words, in a relation R (A, B, C) a multivalued dependency exists if

- A leads to multiple values of C and B, and
- A leads to multiple values of C and
- B and C are independent of the each other.

As we have seen, in the example that SID leads to multiple values of subject and multiple values of activity. Subjects and Activities are autonomous of each other. These multivalued dependencies can be indicated as follows.

**SID         Subject**

**SID         Activity**

This relation is in BCNF (2NF because it is all key, 3NF because it has no non-key determinants).

We can update these anomalies by decomposed STUDENT relation into two relations.

STU-SUBJECT (SID, SUBJECT) and STU-ACT (SID, ACTIVITY), as shown in the figure.

##### Key: (SID, SUBJECT)

SID | FNAME |
---|---|

200 | Music |

200 | Accounting |

250 | Math |

##### Key: (SID, ACTIVITY)

SID | FNAME |
---|---|

200 | Skiing |

200 | Swimming |

250 | Tennis |

250 | Jogging |

**Elimination of Multivalued Dependency**

##### What is Multivalued Dependency?

The multi-valued dependency (MVD) is a functional dependency where the dependency can be to a set and not just a single value. It is defined as **P →→ Q** in relation R(P,Q,R) if each P value is associated with a set of Q values in a way that does not depend on the R values. Here P and Q are both subsets of R. The symbol **P →→ Q** is used to indicate that a set of attributes of Q shows a multi-valued dependency (MVD) on a set of attributes of P.

Multivalued dependency is defined by the double arrow sign(→→).

A relation R satisfies the multi-valued dependency (MVD) P→→Q if, t_{1} (P)=t_{2} (P) and there exists a tuple t_{3}in R with t_{3} (P)=t_{1} (P),t_{3} (Q)=t_{1} (Q) and t_{3} (R)=t_{2} (R).

##### Example

The relation STUDENT, including three attributes STUDENT-CODE, NAME, and COURSE.

STUDENT-CODE | NAME | COURSE |
---|---|---|

121 | Gaurav | B.Tech |

122 | Raman | MCA |

123 | Nita | BCA |

124 | Ramesh | MCA |

In the above relation, STUDENT Name and Course are two independent attributes in itself, but both are dependent on STUDENT-CODE.

In this method, these two attributes are multivalued dependent on STUDENT-CODE. Following are the definition of these dependencies:

**STUDENT-CODE →→ NAME**

**STUDENT-CODE →→ COURSE**

##### Trivial Multivalued Dependency

The trivial type is the most common kind of multi-valued dependency. It has no relation with the fourth normal form apart from a few of the resulting tables from the process that has trivial multi-valued dependencies.

When a table comprises only two fields in which one is multivalued and both fields from the primary key, it is termed as a trivial multi-valued dependency. In the following example, it can be noticed that the double-headed arrow indicated an MVD.

**PARENT-NAME→→CHILD-NAME**

PARENT-NAME | CHILD-NAME |
---|---|

Nita | Saksham |

Virat | Aryan |

Suman | Naira |

**P→→Q** is a trivial MVD if Q is a subset of P or R = P ∪ Q.

An FD **P → Q** is an MVD **P →→ Q** with the additional restrictions that at most one value of **Q** is associated with each value of **P.**

When two multivalued dependencies are present, and they are not dependent on the other MVD, it is termed as a non-trivial multivalued dependency.

Enroll Yourself in Live Training: DBMS Training