Database Unit 4 Normilization 1 1
Database Unit 4 Normilization 1 1
Trivial functional
dependency
Types of Functional
Dependencies Non-trivial functional
dependency
Transitive dependency
Multivalued Dependency
Multivalued dependency occurs when two attributes in a table are
independent of each other but, both depend on a third attribute.
A multivalued dependency consists of at least two attributes that are
dependent on a third attribute that's why it always requires at least three
attributes.
For example, we can't add a new course unless we have at least one
student enrolled on the course.
If we want to add a new course then student details will become
null. So, course can’t be inserted without having student details. This
scenario forms insertion anomaly
Deletion Anomalies
A Delete Anomaly exists when certain attributes are lost because of the
deletion of other attributes
For example, consider what happens if Student S13 is the last student
to leave the course - All information about the course is lost.
Modification Anomalies
The modification anomaly occurs when the record is updated in the relation.
In this anomaly, the modification in the value of specific attribute requires
modification in all records in which that value occurs
• In above table, there is transitive dependency on sname and salutation. Both are
non
• primary key attributes. Change in sname might cause change in salutiation. For
eg, if we change name Ram to Maya then we need to change salutiation too.
Functional Dependencies
Fourth Normal Form (4NF)
A table is in the 4NF if it is in 3NF and has no multivalued
dependencies.
A multivalued dependency exists when there are at least 3 attributes
(like X,Y and Z) in a relation and for value of X there is a well defined set
of values of Y and a well defined set of values of Z. However, the set of
values of Y is independent of set Z and vice versa.
Suppose a student can have more than one subject and more than one
activity.
Note that all three attributes make up the Primary Key.
Note that Student_Id can be associated with many subject as well as
many activities. This scenario is multi valued dependency.
Databases with multivalued dependencies thus exhibit redundancy
Fourth Normal Form (4NF)
Boyce-Codd Normal Form (BCNF)
Boyce-Codd Normal Form (BCNF) is one of the forms of database
normalization. A database table is in BCNF if and only if there are no
non-trivial functional dependencies of attributes on anything other
than a superset of a candidate key.
BCNF is also sometimes referred to as 3.5NF, or 3.5 Normal Form.
For a table to satisfy the Boyce-Codd Normal Form, it should satisfy
the following two conditions:
a) It should be in the Third Normal Form.
b) And, for any dependency A → B, A should be a super key.
The second point sounds a bit tricky, right? In simple words, it means,
that for a dependency A → B, A cannot be a non-prime attribute, if B
is a prime attribute.
Below we have a college enrolment table with columns student_id,
subject and professor.
In the above table student_id, subject together form the primary key,
because using student_id and subject, we can find all the columns of
the table.
Also, there is a dependency between subject and professor, where
subject depends on the professor name.
This table satisfies the 1st Normal form because all the values are
atomic, column names are unique and all the values stored in a
particular column are of same domain.
This table also satisfies the 2nd Normal Form as their is no Partial
Dependency.
And, there is no Transitive Dependency, hence the table also satisfies
the 3rd Normal Form.
But this table is not in Boyce-Codd Normal Form.
Why this table doesn’t satisfy BCNF?
In the table above, student_id, subject form primary key, which means
subject column is a prime attribute.
But, there is one more dependency, professor → subject.
And while subject is a prime attribute, professor is a non-prime
attribute, which is not allowed by BCNF.
To make this relation(table) satisfy BCNF, we will decompose this table
into two tables, student table and professor table.
• Below we have the structure for both the tables.
The End Any Query ?