4th Normal Form - Normalization
4th Normal Form - Normalization
A relation R is in Fourth Normal Form (4NF) if and only if the following conditions are satisfied
simultaneously:
R is already in 3NF or BCNF.
If it contains no multi-valued dependencies.
Multi-Valued Dependency (MVD)
MVD is the dependency where one attribute value is potentially a 'multi-valued fact' about
another. Consider the table
In this example, 'Address' is a multi-valued fact 'Customer Name' and the converse is
also true.
For example, the attribute 'Address' takes on the two values 'New Delhi' and
'Amritsar'for the single 'Customer_Name' value 'Raj'. The attribute 'Customer_Name'
takes on the values 'Raj' and 'Suneet' for the single 'address; value 'Amritsar'.
MVD can be defined informally as follows:
MVDs occur when two or more independent multi valued facts about the same attribute
occur within the same table. It means that if in a relation R having A, B and C as
attributes, B and Care multi-value facts about A, which is represented as A- -B and A J
C, then multi value dependency exist only if B and C are independent of each other.
There are two things to note about this definition.
Firstly, in order for a table to contain MVD, it must have three or more attributes.
Secondly, it is possible to have a table containing two or more attributes which are
interdependent multi valued facts about another attribute.
This does not give rise to an MVD. The attributes giving rise to the multi-valued facts
must be independent of each other consider the following table:
The table lists students, the textbooks; they have borrowed, the librarians issuing them
and the date of borrowing. It contains three multi-valued facts about students, the books
they have borrowed, the librarians who have issued these books to the and the dates
upon which the books were borrowed. However, these multi-valued facts are not
independent of each other. There is clearly an association between librarians, the
textbooks they have issued and the dates upon which they issued the books. Therefore,
there are no MVDs in the table. Note that there is no redundant information in this
table. The fact that student 'Ankit', for example, has borrowed the book 'Mechanics' is
recorded twice, but these are different borrowing, one in April and the other in June and
therefore constitute different items of information.
Now consider another table example involving Course, Student_name and text_book.
This table lists students, the courses they attend and the textbooks they use for these
courses. The text books are prescribed by the authorities for each course, that is, the
students have no say in the matter. Clearly the attributes 'Student_name' and
'Text_book' are multivalued facts about the attribute 'Course'. However, since a student
has no influence over the text books to be used for a course, these multi-valued facts
about courses are independent of each other. Thus the table contains an MVD. Multivalue facts are represented by.
Here, in above database following MVDs exists:
Course --> --> Student_name
Course --> --> Text book
Here, Student_name and Text_book are independent of each other.
Now, we can easily check that all the above anomalies of STUDENT_ COURSE_BOOK
database are removed. For example, if now a new student joins a course then we have to
make only one insertion in COURSE_STUDENT table and if a new book introduced for
a course then again we have to make a single entry in COURSE_BOOK table, so this
modified database eliminate the problem of redundancy which also solves the update
problems.
Practice Session 3:
Example: Consider the following database of STUDENT and normalize it.
STUDENT (Student_Name, Equipment, Language)
This table lists students, the equipment they have allocated to them and the foreign
languages in which they are fluent. This database shows that 'equipment' and 'language'
are independent multi-valued facts about 'Student_Name' that is it contains a multivalued dependency.
This form of the table is obviously full of anomalies. There is a high degree of
redundancy that will lead to update problems. If Raj has his workstation taken away,
then the information about his language skills is lost and if he acquires a PC, then all the
information about his language skills has to be repeated, that is, three new rows have to
be inserted (because of the entity integrity rule).
The table is in BCNF, since all three attributes concatenated together constitute its key,
yet it contain anomalies and requires decomposition. Since the database contain MVDs,
so it should be decomposed with the help of rule of fourth normal form decomposition.
The database contains the following MVDs: