Module2(ADBMS) (5)
Module2(ADBMS) (5)
DATABASE DESIGN
● Database normalization is the process of organizing the attributes of the
database to reduce or eliminate data redundancy (having the same data
but at different places).
● Data redundancy unnecessarily increases the size of the database as the
same data is repeated in many places. Inconsistency problems also arise
during insert, delete, and update operations.
● In the relational model, there exist standard methods to quantify how
efficient a databases is. These methods are called normal forms and
there are algorithms to covert a given database into normal forms.
● Normalization generally involves splitting a table into multiple ones
which must be linked each time a query is made requiring data from the
The primary objective for normalizing the relations is to eliminate the below
anomalies.
● The branch, hod, and office_tel columns have the same values (CSE, Mr. X, 53337) for all students.
● This repetition indicates data redundancy because the information about the branch, HOD, and office contact
number is stored multiple times.
FD X -> Y,then
● Id -> Name
● Name -> DOB
Here, roll_no → name is a non-trivial functional dependency, since the dependent name
is not a subset of determinant roll_no. Similarly, {roll_no, name} → age is also a non-
3.Multivalued Functional Dependency
● In Multivalued functional dependency, entities of the dependent set are not dependent on each
other. i.e. If a → {b, c} and there exists no functional dependency between b and c, then it is
called a multivalued functional dependency.
In this table:
● X: bike_model
● Y: color
● Z: manuf_year
A relation is in the third normal form, if there is no transitive dependency for non-prime
attributes as well as it is in the second normal form. A relation is in 3NF if at least one of the
following conditions holds in every non-trivial functional dependency X –> Y.
● X is a super key.
● Y is a prime attribute (each element of Y is part of some candidate key).
In other words,
A relation that is in First and Second Normal Form and in which no non-primary-key
attribute is transitively dependent on the primary key, then it is in Third Normal Form
(3NF).
If A->B and B->C are two FDs then A->C is called transitive dependency. The
normalization of 2NF relations to 3NF involves the removal of transitive dependencies.
ie, BCDEF
● The attribute that do not present in the right side is A.So A will be a key
or part of a key(No other attributes determines attribute A).
● Take A closure ,ie {A,B,C,D,E,F}
● A closure include all the attributes in a relation.That is A determines every
attributes.
● Thus conclude that A is a candidate key.
1.Find the candidate keys of the below relation.
Boyce-Codd Normal Form (BCNF)
● Boyce-Codd Normal Form (BCNF) is a stricter version of Third Normal Form
(3NF) that ensures a more simplified and efficient database design.
● It enforces that every non-trivial functional dependency must have a superkey
on its left-hand side.
● This approach addresses potential issues with candidate keys and ensures the
database is free from redundancy.
● BCNF eliminates redundancy more effectively than 3NF by strictly requiring
that all functional dependencies originate from super-keys.
● Rules for BCNF
When one attribute in a database depends on another attribute and has many
independent values, it is said to have multivalued dependency (MVD). It supports
maintaining data accuracy and managing intricate data interactions.
Multi Valued Dependency (MVD)
We can say that multivalued dependency exists if the following conditions are met.
Any attribute say a multiple define another attribute b; if any legal relation r(R), for all
pairs of tuples t1 and t2 in r, such that,
t1[a] = t2[a]
Then there exists t3 and t4 in r such that.
t1[a] = t2[a] = t3[a] = t4[a]
t1[b] = t3[b]; t2[b] = t4[b]
t1 = t4; t2 = t3
● Then multivalued (MVD) dependency exists. To check the MVD in given table, we
apply the conditions stated above and we check it with the values in the given
table.
● The table above, student with s_id 1 has opted for two courses, Science and Maths,
and has two hobbies, Cricket and Hockey.
● 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.
To make the above relation satisfy the 4th normal form, we can decompose the
table into 2 tables.