0% found this document useful (0 votes)
3 views

5th Chap DBMS Notes

Normalization is a database design technique proposed by Dr. Edgar F. Codd to organize tables, reducing redundancy and dependency by dividing larger tables into smaller ones linked by relationships. It involves multiple steps and is essential for managing database operations effectively, preventing anomalies such as insert, update, and delete anomalies. Various normalization forms exist, including 1NF, 2NF, 3NF, BCNF, and 4NF, each addressing specific types of data dependencies and ensuring data integrity.

Uploaded by

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

5th Chap DBMS Notes

Normalization is a database design technique proposed by Dr. Edgar F. Codd to organize tables, reducing redundancy and dependency by dividing larger tables into smaller ones linked by relationships. It involves multiple steps and is essential for managing database operations effectively, preventing anomalies such as insert, update, and delete anomalies. Various normalization forms exist, including 1NF, 2NF, 3NF, BCNF, and 4NF, each addressing specific types of data dependencies and ensuring data integrity.

Uploaded by

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

Dalal

CONCEPT OF NORMALIZATION Deslgn)....Page no. (5-7)

Define Normalization. ºRet.:


5.3.1
vQ.53.2 Define Normalization, Discuss different normalization
va. (MU-Q.3(b),
techniques May 15, Dec. 15, Q. 4(a),
with example. Dec. 16, 2 Marks)
Ref. : (MU -Q.2(a), Dec. 17,
5.3,3
Whatis Normalization? Dec. 18,10 Marks)
> Ref. : (MU -
vO. Q.3(b), May 18, 2 Marks)
Ans.:
Dr.EdgarF Codd proposes normalization as an integral part of a relational model.
Normalization is a database design technique which is used to organize the tables in
such manner that it should reduce
redundancy and dependency of data.
Itdivideslarger tables to smaller tables and links thesesmaller tables using their relationships.

Normalization is implemented by following some formal rules either by a process of synthesis or


decomposition.
Synthesis is Used to create database design in normalized form based on a known set of dependencies. Decomposition
generally done on existing database which is not normalized. The relation of this database is further divided into
multiple relations toimprove the design.
Normalization isthe multi step process. It creates smaller tables from larger table.

Types of Normalization

1 Birst normal form (1NF) : Having unique values, no repeating groups.

) Second Normal form (2NE): Having unique values, no repeating groups, no partial dependency.
dependency.
) Third Normal form (3NF) : Same like second normal form and having transitive
moredeveloped version than 3NF.
49) Boyce-Codd Normal form (BCNF) : It is
dependency.
5) Fourth normal form (4NF) : No multi-valued
A 5.3.1 Need of Normalization

GQ. 5.3.4 What is the need of Normalization?

MAns. :
is not easy to manage database
operations like insertion,
process without Normalization, it
In database management
deletion, and modification without facing data loss problem.
Updation and Deletion Anomalies occur frequently. To understand need of
Insertion,
1 daabase is not normalized, then
normalization, first we should learn, what are Anomalies ?
Database

5.3.1(A) Anomalles
in DBMS.
GO. 6.3,5 Explain different anomalies

Ans.:
Anomalies are inconvenient or error-prone situation arising when we process the tables. There are three types Of

anomalies :

A) Insert Anomaly
into the database
An Insert Anomaly occurs when it is not possible to insert certain attributes without the
availability of other attributes.
For example, In College Database System, it is not possible to add entry of any new course unle any student
enrolled for it.

Table 5.3.1 : STUDENT INFO

STUD _ID COURSE ID STU NAME ADDRESS COURSE


S101 C1 Kunal Camp VB

S101 C2 Kunal Camp Java


S102 C3 Radhika Sahkar Nagar Oracle
S103 C4 Kiran Tilak Road C++
S104 CS
Jay Pune Station DS
S105 C3 Pooja Sadashiv Peth Oracle
Here no student has enrolled for the course Dot Net,
hence no entry for course Dot Net.
B) Update Anomaly
An Update Anomaly occurs when there is
requirement of changes in multiple records of an entity, but all records
not get updated.
For Example : Address of Kunal get
changed.
Table 5.3.2 : STUDENT INFO
STUD ID COURSE ID STU NAME ADDRESS
S101 COURSE
C1 Kunal Tilak Road VB
S101 C2 Kunal
S102 C3
Camp Java
Radhika Sahkar Nagar Oracle
S103 C4 Kiran Tilak Road C++
S104 C5
Jay Pune Station DS
S105 C3
Pooja Sadashiv Peth Oracle
C) Delete Anomaly
ADelete Anomaly is opposite to insert anomaly. This anomaly
occurs when data of some attributes get lost
hecause of deletion of data of other attributes in the same record.
Eor Example : Just consider the only one entry for course Oracle of
student Jay is deleted, then there will be no
record related to course 'DS'.
STUD_ID COURSE ID STU NAME ADDRESS COURSE
S101 C1 Kunal Tilak Road VB
Si01 C2 Kunal Camp Java
S102 C3 Radhika Sahkar Nagar Oracle
S103 C4 Kiran Tilak Road C++
S105 C3 Pooja Sadashiv Peth Oracle

To overcome these anomalies we need to normalize the data in database.

M 5.4 FIRST NORMAL FORM (1NF)


UQ. 5.4.1 Explain 1NF.
Ret. : (MU -Q.3(b), May 15, Dec. 15, Q. 4(a), Dec. 16, May 18, Dec. 18, 2Marks) :
V Ans. :

A domain is the set of all unique values which is permitted for an attribute. Atomic means that cannot be divided
further.
First Normal Form defines that all the attributes in a relation must have atomic (not further divisible) and single values.
Consider the table Course_details.
Table 5.4.1:Course_details
Category_id Category_name Languages
C_ PRG Programming C, VB, Java
C_SCR Scripting JavaScript, PHP, HTML
Table 5.4.1 is not in INF as the rule says "each attribute of a table must have atomic (single) values", thé attribute
'Languages' contain multiple values which violets the rule of INF. Toconvert this data into First Normal Form, we
have to rearrange it in the table.
Category_id Category_name Languages
C_PRG Programming C
C_PRG Programming VB
Java
C_PRG Programming
C_SCR Scripting JavaScript
C_SCR Scripting PHP

C_SCR Scripting HTML

Now cach attribute contain single values. Hence the database design is in First Normal Fornm.
Database Manage

a 5.4. Functional Dependency


Functional Dependency.
GO. 5.4.2 Write note on
identifics
Ans. :
when an attribute of atable uniqucly another
The attributes of a relation is said to be dependent
on cach other
dependency.
attribute of the same table. This is called as functional it can represented as
A ’B
attribute B of same relation then which
If attribute Aof arelation uniquely identifies the
means attribute B is functionally dependent on attribute A.
Formal definition of functional dependency
R include A, B.
Let, R be a relation schema with attributes A, B i.e.
Given a relation R, A ’B
functionally dependent on another set of attributes A in R, i.e.
to
ASet of attributes B in R is said
determinant set of attributes and right-hand side of FD means B is the dependent
Left-hand side of FD that is A is the values of
Usually primary key of relation is determinant in FD. Thus, given a row and the
determined set of attributes.
corresponding value of the B attribute.
the attributes in set A,one can determine the
Table 5.4.2 : STUDENT

STUDENT ID STUDENT NAME ADDRESS COURSE


Akash Nagpur Oracle
1001
1002 Anuja Pune Java

1003 Smita Jalgaon Php

From STUDENT ID attribute it is possible to identify particular students' name. Name of the student is functionally
dependent on STUDENT_ ID and not vice versa; because more than two students may have same names and using
STUDENT Dwe can determine the name of student but using STUDENT_NAME we can't determine the appropriate
STUDENT_ID.
So we can say that,

STUDENT_ID ’ STUDENT_NAME
ie. STUDENT_NAME is functionally dependent on STUDENT_D
Similarly,
STUDENT _ID’ allthe attributes(i.e. ADDRESS, COURSE) !!"
So we can say that all the remaining attributes are functionally dependent on
STUDENT ID attribute.
It is possible that an attribute of a relation can be
identified by set of another attributes which are of the same relation.
This can be implies as follows :
STUDENT_ ID, STUDENT _NAME ’ ADDRESS
STUDENT _ID, STUDENT NAME ’ COURSE
In above situation, usually composite primary key
of relation is determinant in FD.
Databaso
M rageno. (5-11)
Functional Dependencies
5.4.1(A)Types of
64.3 Explaintypes offFunctional Dependency.
00.

MAns.:
types of Functional Dependency :
Followingareimportant
valued| FunctionalI Dependency (B) Multi-valued Functional Dependency
(A) Single-
Fully Functional | Dependency (D) Partial Functional
(C) Dependency
Transitive Functional Dependency (F) Trivial Functional
(E) Dependency
(G) Non Trivial Functional Dependency

Dependency
(A) Single-valued Functional
Datohace is a collection of related inforrnation in which information depends on another information.
The information is either single-valued or multi-valued. For example, the narme of the
perSOn or his / her date of
birh is single valued facts. But the Contact number of a person is a multi-valued attribute.
Asingle valued functional dependency is when A is the primary key of an
relation (e.g. STUDENT ID) andB is
ecingle valued attribute of the relation (e.g.
STUDENT _NAME). Then, A ’ B must always hold by the
relation.

STUDENT

STUDENT_D STUDENT_NAME ADDRESS DOB COURSE


1001 Akash Nagpur 11-2-1980 Oracle
1002 Anuja Pune 2-10-1982 Java
1003 Anuja Jalgaon 23-10-1981 PHP
1004 Amruta Nanded 20-9-1981 DBMS
STUDENT_D ’ STUDENT NAME
1002 Anuja
For every STUDENT ID there should be unique name (A - B)

(B) Multi-valued Functional Dependency


GQ. 544 Wite short note on: Multivalued Deperndency.

M Ans.
Amulti-valued dependency exists when a relation R has at least 3 attributes (like A, Band C) and for value of Athere
iS a well defined set of values of B and a well defined set of values ofC. However, the set of values of Bis independent
of set C and více
versa.
For Example
Book
Table 5.4,3 Publlsbed
Prie
Auther Name
Book_Id
Jasmin 1000
B_001
980
B_002 Jasmin
1500
B_003 Smita
Smita 2000
B_004
determined by Book_Jd altribute,
AS Shown in Table 5.4.3, name of particular author s
(Book_ld) >>{Author_Name)
Also it is possible to determine the Price of book by Book_Id.
(Book_Id) ->> (Price)
But it is difficult to determine the price of book Using author name or vice versa. So this dependency is called ..
multi-valued functional dependency or simply multi-valued dependency.
(C) Fully Functional Dependency
Fully Functional Dependency occurs only in a relation with composite primary key. Fully functional dependerey
occurs when one or more non key attributes are depending on all parts of the composite primary key.
Table 5.4,4: Stud_Courses
Stud Id Stud_Name Contact No Course_Id Course Name Credit Hours Grade
1001 Jasmin 9950043321 C_310 Database Management Systern 3 A
1001 Jasmin 9950043321 C_420 Operating System 3 B
1002 Smita 9800678120 C_310 Database Management Systern 3 B
1002 Smita 9800678120 C_420 Operating System 3 B
1002 Smita 9800678120 C_422 Computer Network 3 C
1003 Rahul 8878712356 C_412 Software Engineering 3 A
Here the composite primary key is Stud _Id + Course_Id
Attribute Grade is fully functionally dependent on the
primary keys are needed to determine Grade.
primary key (Stud_Id, Course Jd) because both parts of
the
On the other hand both
Stud_Name, and Contact_No attributes are not fully
because only a part of the primary key namely functionally
Stud ld is needed to determine both Stud dependent the primary key,
on
Also attributes Credit-Hours and Name and Contact_No.
Course-Name
Course-Id isneeded to determine their values.
are not fully functionally
dependent on the primary key because only
Partial Functional Dependency occurs only in a relation with composite primary key. Partial
dendeny cus hen one or more non key attributes are depending on apart of the functional
primary key.
In partial functional dependency the determinant (Left-band side of FD) consists of key attributes, but not the
emtire primary key and the determined (Right-hand side of FD) consist of non-key attributes.

Freumpie,
Course Id
Here the composite primary key is Stud_Id +
Name Contsct_No Course Id Course Name Credit Hours Grade
Jasmin 9950043321 C_310 Database Management System 3
1001 A
Jasmin 9950043321 C_420 Operating System 3
2001 B
Smita 9800678 120 C_310 Database Management System 3 B
I002 Smita 9800678 120 C_420 Operating System 3 B

J002 Smita 9800678 120 C_422 Computer Network 3 C


1003 Rahul 8878712356 C_412 Software Engineering 3 A

To ätemine name of the student or contact number of the student we can use only Stud_Id attribute which is part of
the primary key.
(Stad_Id) {Stud_ Name, Conatct_No}
E Transitive Functional Dependency
G0. 5A5 Describe the concept of transitive dependency.

Ans.:
Functional dependency is said to be transitive if it is indirectly form by using two functional dependencies.
- For example in relation R(A, B, C), Functional dependency F includes:
A’B and B’Cboth the FDs are hold by relation, and if B A doesn't hold
Then we can say that A’Calso holds by the relation.
This type of dependency is called as transitive dependency.
Erample
I Student_Courses relation holds
following FDs:
{Course _Id)’(Student_Name)
(Student Name)’(Student_Age)
e we can say that the relation also holds
following dependency.
(Counse ld)’(Student_Age)
(F) Trivial Functional
Dependency attributes is known as trivial functional dependency if the set of
The dependency of an attribute on a set of
attributes contains the
In this dependency theattribute
Right-Hand
itself. Side of FDis asubset of Left-Hand Side of the FD. Functional dependency of

the form A ’ B is trivial if B is a subset of A.


The
In afunctional
relation, ifdependencies
attribute Ais A, B) ’A
depend on ais set
trivial.
of attributes AB, and also the attribute Ais subset of AB then this

functional dependency is said to be trivial.


For example,
Stud-Courses

Stud ld Name
Stud
1001 Jasmin
1002 Smita

1003 Rahul

(bud ld, Stud_Name} (Stud Id) is a trivial functional dependency as {Stud id} is subset of (Stud Id.
Stud_Name). By knowing the values of id and nanme of the student it is possible to find values of student id
uniquely.
The functional dependencies: olionannt
Stud_Id’ Stud Id and Stud Name ’ Stude_Name
is also referred as trivial dependencies.

(G) Non Trivial Functional Dependency

It is inverse to trivial dependency. Functional Dependency is said to be non trivial if none of the attributes of
Right-Hand Side of FDs are part of the Left-Hand Side attributes.
Functional dependency of the form A’B is non-trivial if valuesin Bare not present in Aie. (B is not asubset
of A).
Non-Trivial Functional Dependency can be categorized into:
A) Armstrong's Axioms
UQ. 5.4.8 Write note on Armstrong's axioms. Ref. : (MU- Q. 6(b), May 18, 5 Marks);
Ans. :
Armstrong'saxioms were developed byWilliam W. Armstrong. These are a set of axioms (or inference rules) which
are used to infer (conclude) all the FDs on a relational database.
Consider a relation R having three sets of attributes X, Y,Z. Then the Armstrong's axioms are :
Reflexivity rule : If in a relation R values of Y attribute set are the subset of values in X attribute set, then
FD X’ Y can hold by the relation R. This type of dependency also called as trivial dependency.
Augmentation rule : If FD X’Y is hold by relation R, then FD XZ’ YZ also hold by relation.
R then the FD X’Z also
Transitivity rule :If Functional dependencies X’ Y and Y ’Z are hold by relation
dependency.
followed by relation R. This type of dependency also called as transitive
Properties of Armstrong's axioms
The Armstrong's Axioms are sound :
Armstrong's
Tunctional dependencies F on arelation R are given, then the FDs generated by using
c basie
axioms will hold by R.
which are previously defined will not generate invalid
ouer Words applying Armstrong axioms on set of FDs
FDs.

given, then each


Ine Armstrong's Axioms are complete: When basic functional dependencies F on a relation R are
and every valid Functional dependency on relation R can be found by applying only Armstrong axioms on set of FDs
which are previously defined.
B) Union or Additivity

I in relation Rhaving three sets of attributes X, Y, Z, and the set of functional dependencies : X’ Yand X’ Zare
hold by relation R, then the functional dependency X’YZ also hold by relation R. This rule is called as union.
C) Decomposition or Projectivity

If in relationR having three sets of attributes X, Y, Zand the functional dependency X’ YZ is hold by relation Rthen
the following sets of Functional dependencies also hold by relation
R: X’Y and XZ

This inference rule is called as decomposition rule.


D) Pseudo transitivity
If in relation R having four sets of attributes W, X, Y, Z
and the functional dependencies XY and YW ’Z are hold
by relation R, then the relation also hold
following functionaldependency XW ’Z. This inference rule known pseudo
transitivity.
5.4.2 Decomposition
GQ. 5.4.9 What is decomposition ?

V Ans. :
One solution to eliminate the
redundancy and also the update and deletion
into two or more relations. This
process is called as decomposition. anomalies in database is breaking a relation
Let, R be a relation schema.
A
set of relation schemas (R1,
R2,..., Rn) is a decomposition of R if
R= RIU R2 ...U Rn
For example,
Let us know how to break the
relation into more than one relation.
Database
Ma
90
rCLASSINFO relation having COURSE_ID, COURSE_NAME, STUD _NAME, SUB_ID, and SUB_NAME.
Consider
Table 5.4.5:CLASSINFO
COURSE_D COURSE_NAME STUD_NAME SUB_ID SUB_NAME
C_101 F.E. Nishant S_112 C
C_102 S.E. Prashant S_212 Java
C_102 S. E. Prashant S_222 DBMS

C_103 T.E Sanvi S_311 Ad. Java

C_101 F.E Sanvi S_115 CPP

decomposed intotwo relations as follows :


Tisrelation can be
COURSE_ STUDENT(cOURSE_ID, cOURSE_NAME, STUD_NAME)
SUBJECT_STUDENT(SUB_ID, SUB_NAME, STUD_NAME)
Table 5.4.6: COURSE_STUDENT
COURSE ID COURSE NAME STUD NAME
C_101 F.E. Nishant
C_102 S. E. Prashant
C_103 T.E Sanvi

C_101 F.E Sanvi

Table 5.4.7 : SUBJECT_STUDENT

SUB ID SUB NAME STÚD NAME


S_112 Nishant

S_212 Java Prashant

S_222 DBMS Prashant


S_311 VB Sanvi

S_115 CPP Sanvi

SUBJECT_STUDENT as follows :
Now try to join these two relations COURSE_STUDENT and
Table 5.4.8: COURSE STUDENT SUBJECT STUDENT
COURSE ID COURSE NAME STUD NAME SUB D SUB NAME
F.E. Nishant S_112 C
C_101
S.E. Prashant S_212 Java
C_102
S. E. Prashant S_222 DBMS
C_102
T.E Sanvi S_311 VB
C_103
C_103 T.E Sanvi S_115 CPP

C_101 F.E Sanvi S_115 CPP


F.E Sanvi S_311 VB
C_101
Database Management System (MU-Comp.) (Helal
Here two additional rows are displayed this statesthat the bad design of decomposition may leads to information loss.

SO, to ensure that the database has g00d desion after decomposing:
the decomposition process S done through some
criteria which is defined by desirable propertics of decomposition.
2 5.4.2(A) Desirable Properties of Decompositions
Decompositon.
DQ. 5.4.10 Explain Lossless join Decomposition and Dependency Preservation
Ref.: (MU -Q. 1(b), May 17,5 Marks)

Ans. :
to hold so that the database remains in consistent state
Whle decomposing the relation there must be some pronerties
There are several properties which are required to hold while decomposing the database scnema.

There are two properties of decomposition :


i) Lossless join Decomposition
i) Dependency Preservation Decomposition

i) Lossless decompositions
does not leads to any
When a relation is decomposed into several relations it is essential that the decomposition
loss of the information.
If there is the loss of the information, then it is called lossy decomposition or lossy-join decomposition.
Decomposition is called as lossless decomposition if there is no loss of information in the decomposition of the
relation into the desirable smaller relations. R(A,B,C)
Decomposition
A decomposition (R1, R2,..., Rn} of a relation R is called a lossless
decomposition for R if the natural join of R1, R2,..., Rn produces
R1(A, B) R2(A, C)
exactly the relation R.

Decomposition is lossless if we can recover to original relation from Recover


combining smaller decomposed relations as follows : e t R-(A, B, C)
Thus, R=R Fig. 5.4.1
Lossless decomposition property
The lossless join decomposition is defined as, if R is a relation schema and F is a set of functional dependencies on
R. Rl and R2 form decomposition of R. If at least one of following functional dependency is hold by F* then the
decomposition is called as lossless-join decomposition.
F:

R1 oR2 ’ R1, that is all attributes common to both RI and R2 functionally determine ALL the attributes in R1
OR

R1o R2> R2, that is all attributes common to both R1 and R2 functionally determine ALL the attributes in R2
In other words, if R1 o R2 forms a superkey of either R1 or R2. The
decomposition of R is a lossless
decomposition.
Dependency
i) D preservation decomposition
To ensure that the functional dependencies hold by relation R should also preserved by the smaller relauo
(RI, R2,.., Rn), the dependency preservation property of decomposition is used.
Adecomposition of the relation R into smaller relations R1, R2, .. Rn is dependency preserving 1au
Functional dependencies within R are followed in relations R1, R2, ., Rn.
Dependency preservation decomposition property
Dependency preservation decomposition is defined as, If R is a relation schema and F is a set of functioal
dependencies on R. R1, R2, ..., Rn form decomposition of R. If(F1 UF2 U... U Fn)" = F
Where,

Fl, F2, ... Fn are the functional dependencies of relation R1, R2, ..., Rn.
Fis a functional dependency of relation R.
(FlUF2 U... UFn)" is a closure of union of all sets of functional dependencies of R1, R2, ..Rn.
Fis a closure of set of functional dependency of relation R.

5.5 SECOND NORMAL FORM (2NF)


UQ. 5.5.1 Explain 2NF. Ref. : (MU - Q. 3(b), May 15, Dec. 15, Q. 4(a), Dec. 16, May 18, Dec. 18, 2 Marks)!

MAns. :
Tounderstand the second normal form first we should get concepts of Prime and Non-prime attributes.
Prime attribute : An attribute, which is a part of the prime-key is known as a prime attribute.
Non-prime attribute: An attribute, which is not a part of the prime-key is said to be a non-prime attribute.
As per the rule of Second Normal Form, every non-prime attribute must be dependent upon the prime attribute.
If we follow second normal form, then every non-prime attribute should be fully functionally dependent on prime key
attribute.

Consider Table 5.5.1.

Table 5.5.1: STUDENT PROJECT

STUD ID PROJ_D STU_NAME PROJ NAME


S101 P1 Kunal Banking System
S102 P2 Radhika Library Management
S103 P3 Kiran Speech to Text Converter

S104 P4 Jay ATM


In the above exanmple the prime key atributes are STUD_ID and PROJ_D. Here the non key atributes like
ST0_NAME and PROJ_NAME are dependent upon one ofthe prime key attributes.
es ODNAME is depend upon STUD ID while the PROJ NAME depends upon PROJ D. This is called as
partial dependency.
AS per the rule of Second Normal Fom the non key attrihutes should be dependent upon all the key attributes which is
not followed.

Toconvert the data in Second Normal Form we have to split the table in two diferent tables as follows.
STUDENT

STUD D STU NAME PROJ NAME


S101 Kunal Banking System
S102 Radhika Library Management
S103 Kiran Speech to Text Converter
S104 Jay ATM

In the table STUDENT all the non prime attributes like STU_NAME and PROJ_ NAME are completely depends upon
the prime attribute STUD_ID
PROJECT

PROJ_ID PROJ_NAME
P1 Banking System
P2 Library Management
P3 Speech to Text Converter
P4 ATM

In the table PROJECT the non prime attributes PROJ_NAME is completely depends upon the prime attribute PROJ_ID. R

5.6 THIRD NORMAL FORM (3NF)

UQ. 5.6.1 Explain 3NF. º Ref.: (MU -Q.3(b), May 15, Dec. 15, Q. 4{a), Dec. 16, May 18, Dec. 18, 2 Marks)
V Ans. :
Adatabase design is said to be in 3NF if both the following conditions are satisfied by it.
Initially the design must be in 2NF.
No non-prime attribute should be transitively dependent on prime key attribute.
For any non-trivial functional dependency, X’ A
Either X is a superkey or A is prime attribute.
Table 5.6.1 : STUDENT
STUD ID STU DETAILS
S101
NAME CITY ZIP
Kunal Pune 411037
S102
Radhika Nasik 422001
S103 Kiran Mumbai 400016
S104
Jay Nagpur 440001
In Table 5.6.1 the STUD Dis the only one
primary key. Here the data of city can be retrieved through
eTUD ID or ZIP code. But the CITY is not superkey as ciner
well as nor the CITY is prime attribute.
1Hare the CITY is depends upon ZIP and ZIP is
depends upon STUD_ID
Stud_id ’ zip ’ city.
This relationship is known as transitive dependency.
We have to remove this transitive dependency by implementing Third Normal Form. For this
purpose we have to splt
the STUDENT_DETAILS table in two different tables say
STUDENT DATA and CITY.
STUDENT DATA CITY
STUD D STU_NAME CITY
ZIP CITY
S101 Kunal Banking System 411037 Pune
S102 Radhika Library Management
422001 |Nasik
S103 Kiran Speech to Text Converter
400016 Mumbai
S104 Jay ATM
440001 Nagpur
Now the database design is converted into Third Normal Form. Here the basically design is already in Second Normal
Form and No non-prime attribute is transitively dependent on prime key attribute.
5.7 BOYCE-CODD NORMAL FORM (BCNF)
Ua. 5.7.1 Explain BCNF. Ret. (MU-a.3(b), May 15, Dec. 15, Q. 4(a), Dec. 16, May 18, 2Marks)
UQ. 5.7.2 Explain BCNF with example. Ref.: (MU -Q. 1(a), May 16, 5 Marks)

MAns. :
Adatabase design is said to be in BCNF if both the following conditions are satisfied by it.
Initially the table must be in 3NF.
For any non-trivial functional dependency X ’ A, Xmust be a super-key.
In above database design, Stud id is the super-key in the relation Student_Data and Zip is the super-key in the relation
City
Stu_ID ’ Stu_name, City
And Zip’ City
Which confirms that both the relations are in BCNF.
5.7.1 Difference between 3NF and BCNF
than 3NF ?
GQ 5.73 Differentiate between BCNE & 3NE. How it is stronger

Ans. :
BCNF
Sr. No. 3NF
Normal Forr
It stands for Third Normal Form. It stands for Boyce-Codd
Adatabase design should be already in 3NF to oDvert
2 Adatabase design should be already in 2NF to in BCNF.
convert in 3NF.

3. Rule : Rule:
dependency.
For any non-trivial functional dependency, X ’ A For any non-trivial functional
X’ A
Either
X is a superkey or
X must be a super-key.
Aisprime attribute
4 3NF is weaker than BCNF. BCNF is stronger than 3NF.
5. 3NF cannot catch all the anomalies. BCNF was developed to capture those anomalies that
could not be captured by 3NF.
6 More redundancy. Less redundancy.
7 Computational time is more. Computational time is less.

The above difference clearly indicates that BCNF is stronger than 3NE.
A 5.7.2 BCNF Decomposition Algorithm
GO. 5.74 Write BCNF Decomposition Algorithm.

VAns. :
Input :Arelation R and functional dependencies F which are hold on R.
Output : A decomposition of R into a set of relations (R1, R2,
R3,.., Rn), all of which are in BCNF.
1. If (R is in BCNF) then
Retum R.
2. Else If (there are BCNF
violation, let's consider one FD as X’Y) then
3 Begin
4. Compute X
5. Decompose R into (RI and R2)
Select RI=X., and let R2 have
inX* attributes X and those attributes of R which are not
6
Compute the sets of FDs S1 and S2 for R1 and
R2, respectively.
7. End
Repalstepsfon I to 5 forRI Iand R2 until all the relations (Ri) are in BCNF.
R
Retumthe union of the result of these compositions.

AampBe
Asfollows::Ifarelation R(A, B, C, D, E) and Functional dependency set Fcontains

A’BC

C->DE

F.
Step 1:Compute closure of

A+>ABCDE

B+’B
C+>CDE
D+>D

E+’E

So it concludes that the candidate key is A for relation R.


Step 2to 4 : Check whether the FD is in BCNF if not decompose it.
Again consider the functional dependency set F:
First FD: A’BC, has candidate key Aat the LHS of FD so it is in BCNF. R(A,B,C,D,E)

Second FD : C>DE, doesn'tcontain LHS as candidate key so it violates the


rule of BCNE. So let's decompose it to make the FD in BCNF, into R1 and R2
R1(A,B,C) R2(C,D,E)
where RI contains attributes contained in FD that is in BCNF and R2 contains
attribute which are in FDs that violates BCNF rule. Fig. 5.7.1
Now RI has set (ABC) which contain attribute A as a key according to the A closure. And R2 has a set (CDE) which
also contain atribute Cas key According to the C" closure. At the end both decomposed relations (R1land R2) are in BCNF
form.

You might also like