You are on page 1of 20

3/19/23, 11:10 PM Types of dependencies in DBMS

Types of dependencies in DBMS


Dependencies in DBMS is a relation between two or more attributes. It has the following types in
DBMS −

Functional Dependency
Fully-Functional Dependency
Transitive Dependency
Multivalued Dependency
Partial Dependency

Let us start with Functional Dependency −

Functional Dependency
If the information stored in a table can uniquely determine another information in the same table,
then it is called Functional Dependency. Consider it as an association between two attributes of
the same relation.

If P functionally determines Q, then

P -> Q

Let us see an example −

<Employee>

EmpID EmpName EmpAge

E01 Amit 28

E02 Rohit 31

In the above table, EmpName is functionally dependent on EmpID because EmpName can
take only one value for the given value of EmpID:

EmpID -> EmpName

The same is displayed below −

https://www.tutorialspoint.com/Types-of-dependencies-in-DBMS 1/3
3/19/23, 11:10 PM Types of dependencies in DBMS

Fully-functionally Dependency
An attribute is fully functional dependent on another attribute, if it is Functionally Dependent on
that attribute and not on any of its proper subset.

For example, an attribute Q is fully functional dependent on another attribute P, if it is


Functionally Dependent on P and not on any of the proper subset of P.

Let us see an example −

<ProjectCost>

ProjectID ProjectCost

001 1000

002 5000

<EmployeeProject>

EmpID ProjectID Days (spent on the project)

E099 001 320

E056 002 190

The above relations states:

EmpID, ProjectID, ProjectCost -> Days

However, it is not fully functional dependent.

Whereas the subset {EmpID, ProjectID} can easily determine the {Days} spent on the project
by the employee.

This summarizes and gives our fully functional dependency −

{EmpID, ProjectID} -> (Days)

Transitive Dependency
When an indirect relationship causes functional dependency it is called Transitive Dependency.
https://www.tutorialspoint.com/Types-of-dependencies-in-DBMS 2/3
3/19/23, 11:10 PM Types of dependencies in DBMS

If P -> Q and Q -> R is true, then P-> R is a transitive dependency.

Multivalued Dependency
When existence of one or more rows in a table implies one or more other rows in the same
table, then the Multi-valued dependencies occur.

If a table has attributes P, Q and R, then Q and R are multi-valued facts of P.

It is represented by double arrow −

->->

For our example:

P->->Q
Q->->R

In the above case, Multivalued Dependency exists only if Q and R are independent attributes.

Partial Dependency
Partial Dependency occurs when a nonprime attribute is functionally dependent on part of a
candidate key.

The 2nd Normal Form (2NF) eliminates the Partial Dependency. Let us see an example −

<StudentProject>

StudentID ProjectNo StudentName ProjectName

S01 199 Katie Geo Location

S02 120 Ollie Cluster Exploration

In the above table, we have partial dependency; let us see how −

The prime key attributes are StudentID and ProjectNo.

As stated, the non-prime attributes i.e. StudentName and ProjectName should be functionally
dependent on part of a candidate key, to be Partial Dependent.

The StudentName can be determined by StudentID that makes the relation Partial Dependent.

The ProjectName can be determined by ProjectID, which that the relation Partial Dependent.

https://www.tutorialspoint.com/Types-of-dependencies-in-DBMS 3/3
3/19/23, 11:13 PM DBMS Normalization: 1NF, 2NF, 3NF and BCNF with Examples - javatpoint

Normalization
A large database defined as a single relation may result in data duplication. This repetition of data may result in:

Making relations very large.

It isn't easy to maintain and update data as it would involve searching many records in relation.

Wastage and poor utilization of disk space and resources.

The likelihood of errors and inconsistencies increases.

So to handle these problems, we should analyze and decompose the relations with redundant data into smaller,
simpler, and well-structured relations that are satisfy desirable properties. Normalization is a process of
decomposing the relations into relations with fewer attributes.

What is Normalization?

Normalization is the process of organizing the data in the database.

Normalization is used to minimize the redundancy from a relation or set of relations. It is also used to
eliminate undesirable characteristics like Insertion, Update, and Deletion Anomalies.

Normalization divides the larger table into smaller and links them using relationships.

The normal form is used to reduce redundancy from the database table.

Why do we need Normalization?

The main reason for normalizing the relations is removing these anomalies. Failure to eliminate anomalies leads to
data redundancy and can cause data integrity and other problems as the database grows. Normalization consists of
a series of guidelines that helps to guide you in creating a good database structure.

Data modification anomalies can be categorized into three types:

Insertion Anomaly: Insertion Anomaly refers to when one cannot insert a new tuple into a relationship due
to lack of data.

Deletion Anomaly: The delete anomaly refers to the situation where the deletion of data results in the
unintended loss of some other important data.

Updatation Anomaly: The update anomaly is when an update of a single data value requires multiple rows
of data to be updated.

https://www.javatpoint.com/dbms-normalization 2/6
3/19/23, 11:13 PM DBMS Normalization: 1NF, 2NF, 3NF and BCNF with Examples - javatpoint

Types of Normal Forms:


Normalization works through a series of stages called Normal forms. The normal forms apply to individual relations.
The relation is said to be in particular normal form if it satisfies constraints.

Following are the various types of Normal forms:

Normal Description
Form

1NF A relation is in 1NF if it contains an atomic value.

2NF A relation will be in 2NF if it is in 1NF and all non-key attributes are fully functional dependent on
the primary key.

3NF A relation will be in 3NF if it is in 2NF and no transition dependency exists.

BCNF A stronger definition of 3NF is known as Boyce Codd's normal form.

4NF A relation will be in 4NF if it is in Boyce Codd's normal form and has no multi-valued
dependency.

5NF A relation is in 5NF. If it is in 4NF and does not contain any join dependency, joining should be
lossless.

Advantages of Normalization

Normalization helps to minimize data redundancy.

Greater overall database organization.

Data consistency within the database.

Much more flexible database design.

Enforces the concept of relational integrity.

https://www.javatpoint.com/dbms-normalization 3/6
3/19/23, 11:13 PM DBMS Normalization: 1NF, 2NF, 3NF and BCNF with Examples - javatpoint

Disadvantages of Normalization
You cannot start building the database before knowing what the user needs.

The performance degrades when normalizing the relations to higher normal forms, i.e., 4NF, 5NF.

It is very time-consuming and difficult to normalize relations of a higher degree.

Careless decomposition may lead to a bad database design, leading to serious problems.

← Prev Next →

For Videos Join Our Youtube Channel: Join Now

Feedback

Send your Feedback to feedback@javatpoint.com

Help Others, Please Share

Award Winning Cloud LM

Paradiso Solutions Op

Learn Latest Tutorials

Splunk SPSS Swagger Transact-SQL Tumblr

https://www.javatpoint.com/dbms-normalization 4/6
3/19/23, 11:16 PM Armstrong's Axioms in Functional Dependency in DBMS - GeeksforGeeks

DSA Data Structures Algorithms Interview Preparation Data Science Topic-wise Practice C C

Armstrong’s Axioms in Functional Dependency


in DBMS
Difficulty Level : Basic ● Last Updated : 23 Jun, 2021

Read Discuss

Prerequisite – Functional Dependencies

The term Armstrong axioms refer to the sound and complete set of inference rules or

axioms, introduced by William W. Armstrong, that is used to test the logical implication of

functional dependencies. If F is a set of functional dependencies then the closure of F,

denoted as , is the set of all functional dependencies logically implied by F. Armstrong’s

Axioms are a set of rules, that when applied repeatedly, generates a closure of functional

dependencies.

Axioms –

1. Axiom of reflexivity –

If is a set of attributes and is subset of , then holds . If then

This proper ty is trivial proper ty.

2. Axiom of augmentation –

If holds and is attribute set, then also holds. That is adding

attributes in dependencies, does not change the basic dependencies. If , then

for any .

3. Axiom of transitivity –

Same as the transitive rule in algebra, if holds and holds, then

also holds. is called as functionally that determines . If

and , then

Secondar y Rules –

These rules can be derived from the above axioms.

We use cookies to ensure you have the best browsing experience on our website. By using our Got It !
site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy

https://www.geeksforgeeks.org/armstrongs-axioms-in-functional-dependency-in-dbms/ 1/5
3/19/23, 11:16 PM Armstrong's Axioms in Functional Dependency in DBMS - GeeksforGeeks

Start Your Coding Journey Now!


1. Union –

If holds and holds, then


Login holds. If
Registerand

then

2. Composition –

If and holds, then holds.

3. Decomposition –

If holds then and hold. If then

and

4. Pseudo Transitivity –

If holds and holds, then holds. If and

then .

Why armstrong axioms refer to the Sound and Complete ?

By sound, we mean that given a set of functional dependencies F specified on a relation

schema R, any dependency that we can infer from F by using the primar y rules of

Armstrong axioms holds in ever y relation state r of R that satisfies the dependencies in F.

By complete, we mean that using primar y rules of Armstrong axioms repeatedly to infer

dependencies until no more dependencies can be inferred results in the complete set of all

possible dependencies that can be inferred from F.

Complete Interview Preparation - Self Paced


A LIVE course designed for aspiring SDEs looking to switch to top
product-based companies. Mentored by industry

130+ hours 523k+ views

Certification Program ENROLL NOW

References –

Book – Fundamentals of Database Systems

http://tinman.c s.gsu.edu

This ar ticle is contributed by Samit Mandal. If you like GeeksforGeeks and would like to

contribute, you can also write an ar ticle using contribute.geeksforgeeks.org or mail your

ar ticle to contribute@geeksforgeeks.org. See your ar ticle appearing on the GeeksforGeeks

main page and help other Geeks.


We use cookies to ensure you have the best browsing experience on our website. By using our
site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy

https://www.geeksforgeeks.org/armstrongs-axioms-in-functional-dependency-in-dbms/ 2/5
3/19/23, 11:19 PM Computer Science and Engineering - Tutorials, Notes, MCQs, Questions and Answers: Closure of Set of Functional Depend…

Computer Science and Engineering - Tutorials, Notes, MCQs, Questions and Answers

One stop guide to computer science students for solved questions, Notes, tutorials, solved exercise
online quizzes, MCQs and more on DBMS, Advanced DBMS, Data Structures, Operating Systems
Machine learning, Natural Language Processing etc.

Advanced Database Concepts Data structures, Operating Systems Natural Language Processing Quiz Questions and

DBMS, ADBMS Question Bank SQL RDBMS Exam and Interview Questions Parallel Databases ADBMS Quizzes

Advanced DBMS Concepts Distributed Databases Modern Databases - Special Purpose Databases

Object Based Database Systems

Please visit, subscribe and share 10 Minutes Lectures in Computer Science

Sunday, March 2, 2014 Translate

Closure of Set of Functional Dependencies Select Language

Powered by Translat

Closure / Closure of Set of Functional Dependencies / Different ways to identify


set of functional dependencies that are holding in a relation / what is meant by
A SIGN
the closure of a set of functional dependencies illustrate with an example
NEW TIM
Introduction Every action co
Functional Dependencies are the important components in database design which would help us in identifying bad designs. Another important Join our journ
functionality of FDs is that they really express the facts about the database we are designing. Hence, it is very vital to identify all the possible set to slash our CO2 fo
of functional dependencies hold in a table (relation). #ambition20

What are the ways to identify functional dependencies?

Discover Mo

1. Very simple way is to look for the dependency of one or more columns on the other columns using a sample data set.
The problem here is that the data set we are about to use is not complete. Hence, for some attributes we can anticipate the future set of values
to be stored. But for most of the attributes, it is impossible. Especially, when a table is of more number of columns, it’s a kind of impossibility to
express all the FDs holding by all the attributes. Hence, the set of functional dependencies which one could infer from the table directly is
incomplete.
2. The second way is to identify the basic set of functional dependencies holding on a table which are easily visible and error free. Then, apply
T&Cs apply.
closure of set of Functional dependencies rules to derive the other hidden functional dependencies holding on the relation. We would
mention those hidden functional dependencies as “functional dependencies that are logically implied”. When we are able to identify all the
set of FDs holding by a relation, then we could say that the set F of FDs is complete.
Share Your Articles
In this post let us discuss about Closure of Set of Functional Dependencies.

Closure of Set of Functional Dependencies Share Your Articles


You can share your ar
"The closure of F, denoted as F+, is the set of all regular Functional Dependencies that can be derived from F".
questions, etc on any
This is used to discover some of the hidden functional dependencies so as to design a better database.
computer science sub
clicking the above IMA
Consider the Armstrong's axioms developed by William W.Armstrong. Those axioms provide simpler technique to identify set of other functional
dependencies (hidden). Let us list all the axioms along with the additional rules once again. Pages

Home
RDBMS Exam and Interv
Quiz Questions and Answ
Other Computer Science
Reflexivity rule If X is a set of attributes, and Y is subset of X, then we would say, X → Y.
Parallel Databases
Augmentation rule If X → Y, and Z is another set of attributes, then we write XZ → XY.
ADBMS Quizzes
Transitivity rule If X → Y, and Y → Z, then X → Z is true.
Advanced DBMS Conce

https://www.exploredatabase.com/2014/03/closure-of-set-of-functional-dependencies.html 1/3
3/19/23, 11:19 PM Computer Science and Engineering - Tutorials, Notes, MCQs, Questions and Answers: Closure of Set of Functional Depend…
Union rule If X → Y and X → Z, then X → YZ is true. Distributed Databases
Decomposition rule Its reverse of Rule 4. If X → YZ, then X → Y, and X → Z are true Advanced Database Con

Pseudotransitivity rule If X → Y and ZY → A are true, then XZ → A is also true. Links to Useful Video Lec
SQL
DBMS, ADBMS Question
Animations, Graphics, an
Modern Databases - Spe
Databases
Let us consider set F of functional dependencies hold on a relation R. We can derive additional functional dependencies from the set of given
Object Based Database
functional dependencies. But, still we may have some more hidden functional dependencies. We could derive some of the additional hidden
Miscellaneous
functional dependencies from F on applying the above listed rules. In other words, we could deduce a new functional dependency from two or
Privacy policy
more functional dependencies of set F. Suppose, R is a relation with attributes (A, B, C, D, E, F) and with the identified set F of functional
dependencies as follows; Natural Language Proce
F = { A → B, A → C, CD → E, B → E, CD → F }
Let us apply the above listed rules on every functional dependency of F to identify the member of F+ (the closure of functional dependency is Vellore Institute of Technolo
termed as F+, i.e, set F added with new members resulting in F+).
Ranked within top 200 in
University Rankings 2022
1. A → E is logically implied. From our F we have two FDs A → B and B → E. By applying Transitivity rule, we could infer A → E. That is, if A Seven Subjects of VIT ar
can uniquely determine B and B can uniquely determine E then A can determine E (through B). World University Ranking
2021.
12th best research institu

Math Problems Solved Open


(NIRF Ranking, Govt. of
NAAC Accreditation with
Ask questions and get answers. he.net the last three consecutive

2. A → BC is logically implied. It can be inferred from the FDs A → B and A → C using Union rule. Recognized as Institution
Eminence(IoE), Govt. of
3. CD → EF is logically implied by FDs CD → E and CD → F using Union rule.
4. AD → F is logically implied by FDs A → C and CD → F using Pseudotransitivity rule.
Labels
Like this, we can continue identifying the new members for F+. The procedure to find set F+ can be written as follows in pseudo code.
Normalization
Database Quiz
F+ = F Machine Learning
Repeat Distributed Database
For each functional dependency FD in F+ Data Structures (41) Q
Apply reflexivity and augmentation rules on f (36) NLP Quiz Q
Add the result to F+ Transaction Manag
For each pair of functional dependencies f1 and f2 in F+ Solved Exercises (34)
If f1 and f2 can be combined using Transitivity
DBMS Question Paper
Add the result to F+
Real Time Database (2
Until F+ does not change any further. (20) Parallel Database (1
Normal Forms (16) Objec
2PC Protocol (13) NLP sol
This procedure does not show the additional rules Union, Decomposition, and Pseudotransitivity. The reason is, these additional rules are natural language proces
actually inferred from basic axioms. Also additional rules can be proved using Armstrong’s axioms. The procedure can be stopped when we Storage Access Exercises (
started to get the functional dependencies already existing in F+. (12) Concurrency Control (
Distributed Database Quiz
(9) Transaction (8) ACID
For a relation with set of n attributes, there are 2n+1 possible functional dependencies. For example, if R has 3 attributes, then 23+1 = 16
Languages (7) Intraoperati
functional dependencies are possible. Distributed Lock Manager
Transaction (4) File organ
Processing (4) Fragmentation

Go to Normalization - Solved Exercises page

Go to How to find closure of an attribute? page

RELATED POSTS:

Set of FDs are Normalization Normalization in Functional Relational model


equivalent or not process multiple DBMS - Multiple dependencies in DBMS Multiple
Ex... choi... Ch... and normali... c...

By Saravanakumar Kandasamy - March 02, 2014

Labels: Minimal cover, Normalization

Newer Post Home Older Post

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

https://www.exploredatabase.com/2014/03/closure-of-set-of-functional-dependencies.html 2/3
3/19/23, 11:21 PM What is the minimal set of functional dependencies or canonical cover of FD

What is the minimal set of functional dependencies or


canonical cover of FD?
A minimal cover of a set of functional dependencies (FD) E is a minimal set of dependencies F
that is equivalent to E.

The formal definition is: A set of FD F to be minimal if it satisfies the following conditions −

Every dependency in F has a single attribute for its right-hand side.

We cannot replace any dependency X->A in F with a dependency Y->A, where Y is a proper
subset of X, and still have a set of dependencies that is equivalent to F.

We cannot remove any dependency from F and still have a set of dependencies that are
equivalent to F.

Canonical cover is called minimal cover which is called the minimum set of FDs. A set of FD FC
is called canonical cover of F if each FD in FC is a −

Simple FD.
Left reduced FD.
Non-redundant FD.

Simple FD − X->Y is a simple FD if Y is a single attribute.

Left reduced FD − X->Y is a left reduced FD if there are no extraneous attributes in X.


{extraneous attributes: Let XA->Y then, A is a extraneous attribute if X_>Y}

Non-redundant FD − X->Y is a Non-redundant FD if it cannot be derived from F- {X->y}.

Example
Consider an example to find canonical cover of F.

The given functional dependencies are as follows −

A -> BC

B -> C

A -> B

AB -> C

Minimal cover: The minimal cover is the set of FDs which are equivalent to the given FDs.

Canonical cover: In canonical cover, the LHS (Left Hand Side) must be unique.

First of all, we will find the minimal cover and then the canonical cover.
https://www.tutorialspoint.com/what-is-the-minimal-set-of-functional-dependencies-or-canonical-cover-of-fd 1/2
3/19/23, 11:21 PM What is the minimal set of functional dependencies or canonical cover of FD

First step − Convert RHS attribute into singleton attribute.

A -> B

A -> C

B -> C

A -> B

AB -> C

Second step − Remove the extra LHS attribute

Find the closure of A.

A+ = {A, B, C}

So, AB -> C can be converted into A -> C

A -> B

A -> C

B -> C

A -> B

A -> C

Third step − Remove the redundant FDs.

A -> B

B -> C

Now, we will convert the above set of FDs into canonical cover.

The canonical cover for the above set of FDs will be as follows −

A -> BC

B -> C

https://www.tutorialspoint.com/what-is-the-minimal-set-of-functional-dependencies-or-canonical-cover-of-fd 2/2
3/19/23, 11:23 PM DBMS 1NF - javatpoint

First Normal Form (1NF)


A relation will be 1NF if it contains an atomic value.

It states that an attribute of a table cannot hold multiple values. It must hold only single-valued attribute.

First normal form disallows the multi-valued attribute, composite attribute, and their combinations.

Example: Relation EMPLOYEE is not in 1NF because of multi-valued attribute EMP_PHONE.

EMPLOYEE table:

EMP_ID EMP_NAME EMP_PHONE EMP_STATE

14 John 7272826385, UP
9064738238

20 Harry 8574783832 Bihar

12 Sam 7390372389, Punjab


8589830302

The decomposition of the EMPLOYEE table into 1NF has been shown below:

EMP_ID EMP_NAME EMP_PHONE EMP_STATE

14 John 7272826385 UP

14 John 9064738238 UP

20 Harry 8574783832 Bihar

12 Sam 7390372389 Punjab

12 Sam 8589830302 Punjab

← Prev Next →

https://www.javatpoint.com/dbms-first-normal-form 2/5
3/19/23, 11:24 PM DBMS 2NF - javatpoint

Second Normal Form (2NF)


In the 2NF, relational must be in 1NF.

In the second normal form, all non-key attributes are fully functional dependent on the primary key

Example: Let's assume, a school can store the data of teachers and the subjects they teach. In a school, a teacher
can teach more than one subject.

TEACHER table

TEACHER_ID SUBJECT TEACHER_AGE

25 Chemistry 30

25 Biology 30

47 English 35

83 Math 38

83 Computer 38

In the given table, non-prime attribute TEACHER_AGE is dependent on TEACHER_ID which is a proper subset of a
candidate key. That's why it violates the rule for 2NF.

To convert the given table into 2NF, we decompose it into two tables:

TEACHER_DETAIL table:

TEACHER_ID TEACHER_AGE

25 30

47 35

83 38

TEACHER_SUBJECT table:

https://www.javatpoint.com/dbms-second-normal-form 2/5
3/19/23, 11:25 PM 3NF in DBMS | Third Normal Form - javatpoint

Third Normal Form (3NF)


A relation will be in 3NF if it is in 2NF and not contain any transitive partial dependency.

3NF is used to reduce the data duplication. It is also used to achieve the data integrity.

If there is no transitive dependency for non-prime attributes, then the relation must be in third normal form.

A relation is in third normal form if it holds atleast one of the following conditions for every non-trivial function
dependency X → Y.

1. X is a super key.

2. Y is a prime attribute, i.e., each element of Y is part of some candidate key.

Example:

EMPLOYEE_DETAIL table:

EMP_ID EMP_NAME EMP_ZIP EMP_STATE EMP_CITY

222 Harry 201010 UP Noida

333 Stephan 02228 US Boston

444 Lan 60007 US Chicago

555 Katharine 06389 UK Norwich

666 John 462007 MP Bhopal

Super key in the table above:

{EMP_ID}, {EMP_ID, EMP_NAME}, {EMP_ID, EMP_NAME, EMP_ZIP}....so on

Candidate key: {EMP_ID}

Non-prime attributes: In the given table, all attributes except EMP_ID are non-prime.

https://www.javatpoint.com/dbms-third-normal-form 2/6
3/19/23, 11:25 PM 3NF in DBMS | Third Normal Form - javatpoint

Here, EMP_STATE & EMP_CITY dependent on EMP_ZIP and EMP_ZIP dependent on EMP_ID. The non-prime
attributes (EMP_STATE, EMP_CITY) transitively dependent on super key(EMP_ID). It violates the rule of third
normal form.

That's why we need to move the EMP_CITY and EMP_STATE to the new <EMPLOYEE_ZIP> table, with EMP_ZIP
as a Primary key.

EMPLOYEE table:

EMP_ID EMP_NAME EMP_ZIP

222 Harry 201010

333 Stephan 02228

444 Lan 60007

555 Katharine 06389

666 John 462007

EMPLOYEE_ZIP table:

EMP_ZIP EMP_STATE EMP_CITY

201010 UP Noida

02228 US Boston

60007 US Chicago

06389 UK Norwich

462007 MP Bhopal

← Prev Next →

For Videos Join Our Youtube Channel: Join Now

Feedback

Send your Feedback to feedback@javatpoint.com

https://www.javatpoint.com/dbms-third-normal-form 3/6
3/19/23, 11:25 PM BCNF in DBMS: Boyce-Codd Normal Form - javatpoint

Boyce Codd normal form (BCNF)


BCNF is the advance version of 3NF. It is stricter than 3NF.

A table is in BCNF if every functional dependency X → Y, X is the super key of the table.

For BCNF, the table should be in 3NF, and for every FD, LHS is super key.

Example: Let's assume there is a company where employees work in more than one department.

EMPLOYEE table:

EMP_ID EMP_COUNTRY EMP_DEPT DEPT_TYPE EMP_DEPT_NO

264 India Designing D394 283

264 India Testing D394 300

364 UK Stores D283 232

364 UK Developing D283 549

In the above table Functional dependencies are as follows:

EMP_ID → EMP_COUNTRY
EMP_DEPT → {DEPT_TYPE, EMP_DEPT_NO}

Candidate key: {EMP-ID, EMP-DEPT}

The table is not in BCNF because neither EMP_DEPT nor EMP_ID alone are keys.

To convert the given table into BCNF, we decompose it into three tables:

EMP_COUNTRY table:

EMP_ID EMP_COUNTRY

264 India

https://www.javatpoint.com/dbms-boyce-codd-normal-form 2/6
3/19/23, 11:25 PM BCNF in DBMS: Boyce-Codd Normal Form - javatpoint

264 India

EMP_DEPT table:

EMP_DEPT DEPT_TYPE EMP_DEPT_NO

Designing D394 283

Testing D394 300

Stores D283 232

Developing D283 549

EMP_DEPT_MAPPING table:

EMP_ID EMP_DEPT

D394 283

D394 300

D283 232

D283 549

Functional dependencies:

EMP_ID → EMP_COUNTRY
EMP_DEPT → {DEPT_TYPE, EMP_DEPT_NO}

Candidate keys:

For the first table: EMP_ID


For the second table: EMP_DEPT
For the third table: {EMP_ID, EMP_DEPT}

Now, this is in BCNF because left side part of both the functional dependencies is a key.

https://www.javatpoint.com/dbms-boyce-codd-normal-form 3/6
3/19/23, 11:27 PM Difference between BCNF and 4NF in DBMS - GeeksforGeeks

Start Your Coding Journey Now!


S.No. BCNF
Login
4NF
Register

1 A relation in BCNF must also be A relation in 4NF must also be in Boyce

in 3NF. Codd Normal Form (BCNF).

2 A relation in BCNF may have <A relation in 4NF must not have any

multi-valued dependency. multi-valued dependency.

3 A relation in BCNF may or may A relation in 4NF is always in BCNF.

not be in 4NF.

4 BCNF is less stronger in 4NF is more stronger in comparison to

comparison to 4NF. BCNF.

5 If a relation is in BCNF then it If a relation is in 4NF then it will have

will have more redundancy as less redundancy as compared to BCNF .

compared to 4NF.

6 If a relation is in BCNF then all If a relation is in 4NF then all

redundancy based on functional redundancy based on functional

dependency has been removed. dependency as well as multi-valued

dependency has been removed.

7 For a relation, number of tables For a relation, number of tables in 4NF is

in BCNF is less than or equal to greater than or equal to number of

number of tables in 4NF. tables in BCNF.

8 Dependency preser ving is hard Dependency preser ving is more hard to

to achieve in BCNF. achieve in 4NF as compared to BCNF.

9 In real world database In real world database designing,

designing, generally 3NF or generally 4NF is not preferred by

BCNF is preferred. database designer.

10 A relation in BCNF may contain A relation in 4NF may only contain join

multi-valued as well as join dependency.

dependency.

We use cookies to ensure you have the best browsing experience on our website. By using our
site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy

https://www.geeksforgeeks.org/difference-between-bcnf-and-4nf-in-dbms/ 2/5
3/19/23, 11:28 PM Difference between 4NF and 5NF - GeeksforGeeks

Start Your Coding Journey Now!


Mobile Number Hobby

9999900000 Singing

8975622122 Singing

Thus if natural join is per formed on all the three relations then there will be no extra

tuples.Hence R1, R2 and R3 are in fif th normal form (5NF).

Difference between 4NF and 5NF :

S.NO 4NF 5NF

1. A relation in 4NF must also be A relation in 5NF must also be in

in BCNF(Boyce Codd Normal 4NF(Four th Normal Form).

Form).

2. A relation in 4NF must not have A relation in 5NF must not have any join

any multi-valued dependency. dependency.

3. A relation in 4NF may or may A relation in 5NF is always in 4NF

not be in 5NF.

4. Four th Normal Form is less Fif th Normal form is more stronger than

stronger in comparison to Fif th Four th Normal Form.

Normal form.

5. If a relation is in Four th Normal If a relation is in Fif th Normal Form then it

Form then it will have more will less redundancy.

redundancy.

6. If a relation is in Four th Normal If a relation is in Fif th Normal Form then it

Form then it may be cannot be decomposed fur ther into sub-

decomposed fur ther into sub- relations without any modification in

relations. meaning or facts.

Related Articles

1. Difference between BCNF and 4NF in DBMS


We use cookies to ensure you have the best browsing experience on our website. By using our
site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy

https://www.geeksforgeeks.org/difference-between-4nf-and-5nf/ 5/8

You might also like