The Wayback Machine - https://web.archive.org/web/20240910021738/https://www.geeksforgeeks.org/boyce-codd-normal-form-bcnf/
Open In App

Boyce-Codd Normal Form (BCNF)

Last Updated : 11 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Pre-Requisite: First Normal Form, Second Normal Form, Third Normal Form

Application of the general definitions of 2NF and 3NF may identify additional redundancy caused by dependencies that violate one or more candidate keys. However, despite these additional constraints, dependencies can still exist that will cause redundancy to be present in 3NF relations. This weakness in 3NF resulted in the presentation of a stronger normal form called the Boyce-Codd Normal Form (Codd, 1974).

Although, 3NF is an adequate normal form for relational databases, still, this (3NF) normal form may not remove 100% redundancy because of X−>Y functional dependency if X is not a candidate key of the given relation. This can be solved by Boyce-Codd Normal Form (BCNF). 

Boyce-Codd Normal Form (BCNF)

Boyce–Codd Normal Form (BCNF) is based on functional dependencies that take into account all candidate keys in a relation; however, BCNF also has additional constraints compared with the general definition of 3NF.

Rules for BCNF

Rule 1: The table should be in the 3rd Normal Form.

Rule 2: X should be a superkey for every functional dependency (FD) X−>Y in a given relation. 

Note: To test whether a relation is in BCNF, we identify all the determinants and make sure that they are candidate keys.

BCNF in DBMS

BCNF in DBMS

You came across a similar hierarchy known as the Chomsky Normal Form in the Theory of Computation. Now, carefully study the hierarchy above. It can be inferred that every relation in BCNF is also in 3NF. To put it another way, a relation in 3NF need not be in BCNF. Ponder over this statement for a while. 

To determine the highest normal form of a given relation R with functional dependencies, the first step is to check whether the BCNF condition holds. If R is found to be in BCNF, it can be safely deduced that the relation is also in 3NF, 2NF, and 1NF as the hierarchy shows. The 1NF has the least restrictive constraint – it only requires a relation R to have atomic values in each tuple. The 2NF has a slightly more restrictive constraint. 

The 3NF has a more restrictive constraint than the first two normal forms but is less restrictive than the BCNF. In this manner, the restriction increases as we traverse down the hierarchy. 

Examples

Here, we are going to discuss some basic examples which let you understand the properties of BCNF. We will discuss multiple examples here.

Example 1

Let us consider the student database, in which data of the student are mentioned.

Stu_ID Stu_Branch Stu_Course Branch_Number Stu_Course_No
101 Computer Science & Engineering DBMS B_001 201
101 Computer Science & Engineering Computer Networks B_001 202
102 Electronics & Communication Engineering VLSI Technology B_003 401
102 Electronics & Communication Engineering Mobile Communication B_003 402

Functional Dependency of the above is as mentioned:

Stu_ID −> Stu_Branch
Stu_Course −> {Branch_Number, Stu_Course_No}

Candidate Keys of the above table are: {Stu_ID, Stu_Course}

Why this Table is Not in BCNF?

The table present above is not in BCNF, because as we can see that neither Stu_ID nor Stu_Course is a Super Key. As the rules mentioned above clearly tell that for a table to be in BCNF, it must follow the property that for functional dependency X−>Y, X must be in Super Key and here this property fails, that’s why this table is not in BCNF.

How to Satisfy BCNF?

For satisfying this table in BCNF, we have to decompose it into further tables. Here is the full procedure through which we transform this table into BCNF. Let us first divide this main table into two tables Stu_Branch and Stu_Course Table.

Stu_Branch Table

Stu_ID Stu_Branch
101 Computer Science & Engineering
102 Electronics & Communication Engineering

Candidate Key for this table: Stu_ID.

Stu_Course Table

Stu_Course Branch_Number Stu_Course_No
DBMS B_001 201
Computer Networks B_001 202
VLSI Technology B_003 401
Mobile Communication B_003 402

Candidate Key for this table: Stu_Course.

Stu_ID to Stu_Course_No Table

Stu_ID Stu_Course_No
101 201
101 202
102 401
102 402

Candidate Key for this table: {Stu_ID, Stu_Course_No}.

After decomposing into further tables, now it is in BCNF, as it is passing the condition of Super Key, that in functional dependency X−>Y, X is a Super Key.

Example 2

Find the highest normal form of a relation R(A, B, C, D, E) with FD set as:

{ BC->D, AC->BE, B->E } 

Explanation:

  • Step-1: As we can see, (AC)+ ={A, C, B, E, D} but none of its subsets can determine all attributes of the relation, So AC will be the candidate key. A or C can’t be derived from any other attribute of the relation, so there will be only 1 candidate key {AC}.
  • Step-2: Prime attributes are those attributes that are part of candidate key {A, C} in this example and others will be non-prime {B, D, E} in this example.
  • Step-3: The relation R is in 1st normal form as a relational DBMS does not allow multi-valued or composite attributes.

The relation is in 2nd normal form because BC->D is in 2nd normal form (BC is not a proper subset of candidate key AC) and AC->BE is in 2nd normal form (AC is candidate key) and B->E is in 2nd normal form (B is not a proper subset of candidate key AC). 

The relation is not in 3rd normal form because in BC->D (neither BC is a super key nor D is a prime attribute) and in B->E (neither B is a super key nor E is a prime attribute) but to satisfy 3rd normal for, either LHS of an FD should be super key or RHS should be a prime attribute. So the highest normal form of relation will be the 2nd Normal form. 

Note: A prime attribute cannot be transitively dependent on a key in BCNF relation. 

Consider these functional dependencies of some relation R

AB ->C 
C ->B 
AB ->B

From the above functional dependency, we get that the candidate key of R is AB and AC. A careful observation is required to conclude that the above dependency is a Transitive Dependency as the prime attribute B transitively depends on the key AB through C. Now, the first and the third FD are in BCNF as they both contain the candidate key (or simply KEY) on their left sides. The second dependency, however, is not in BCNF but is definitely in 3NF due to the presence of the prime attribute on the right side. So, the highest normal form of R is 3NF as all three FDs satisfy the necessary conditions to be in 3NF. 

Example 3

For example consider relation R(A, B, C)

A -> BC, 
B -> A

A and B both are super keys so the above relation is in BCNF. 

Note: BCNF decomposition may always not be possible with dependency preserving, however, it always satisfies the lossless join condition. For example, relation R (V, W, X, Y, Z), with functional dependencies:

V, W -> X
Y, Z -> X
W -> Y

It would not satisfy dependency preserving BCNF decomposition. 

Note: Redundancies are sometimes still present in a BCNF relation as it is not always possible to eliminate them completely.

There are also some higher-order normal forms, like the 4th Normal Form and the 5th Normal Form.

For more, refer to the 4th and 5th Normal Forms.



Previous Article
Next Article

Similar Reads

Difference between BCNF and 4NF in DBMS
1. Boyce-Codd Normal Form (BCNF) : Any relation is said to be in the BCNF if and only if it satisfies the following condition : For every Functional Dependency (FD) X->Y, X is SuperKey in given relation. 2. 4th Normal Form (4NF) : Any relation is said to be in the fourth normal form when it satisfies the following conditions : It must be in Boyc
2 min read
Difference between 3NF and BCNF in DBMS
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. The Boyce-Codd Normal Form (BCNF) is based on functional dependencies, BCNF has additional constraints when compared to the basic definition of 3NF. In this article, we will see the differences between 3N
4 min read
Introduction of Relational Model and Codd Rules in DBMS
Pre-Requisite: Relational Model in DBMS It was proposed by Dr. E.F. Codd. It uses the concept of relations to represent each and every file. Relations are Two-Dimensional Tables. It is easy to implement and easy to simplification in the operations to manipulate the data. This is the most popular data model. It is simple to implement. It uses the pr
12 min read
OLAP Guidelines (Codd's Rule)
On-line Analytical Processing (OLAP) is a category of software technology that enables analytics, managers and executives to gain insight into data through fast, consistent, interactive access in a wide variety of information that has been transformed from the raw data to reflect the real dimensionality of the enterprise as understood by the user.
2 min read
Codd's Rules in DBMS
Codd's rules are proposed by a computer scientist named Dr. Edgar F. Codd and he also invent the relational model for database management. These rules are made to ensure data integrity, consistency, and usability. This set of rules basically signifies the characteristics and requirements of a relational database management system (RDBMS). In this a
3 min read
Converting Context Free Grammar to Chomsky Normal Form
Prerequisite - Simplifying Context Free Grammars A context free grammar (CFG) is in Chomsky Normal Form (CNF) if all production rules satisfy one of the following conditions: A non-terminal generating a terminal (e.g.; X->x) A non-terminal generating two non-terminals (e.g.; X->YZ) Start symbol generating ε. (e.g.; S-> ε) Consider the following gra
4 min read
Domain Key Normal Form in DBMS
Prerequisites - Normal Forms, 4th and 5th Normal form, find the highest normal form of a relation It is basically a process in database to organize data efficiently. Basically there are two goals of doing normalization these are as follows: To remove repeated data or in simple words we can say to remove redundant data.Second one is to ensure that t
4 min read
What is PJNF(Project-Join Normal Form)?
Fifth normal form (5NF), is also known as project-join normal form (PJNF). It is a level of database normalization designed to reduce redundancy in relational databases. A relation is said to be in 5NF if and only if it satisfies 4NF and no join dependency exists. A relation is said to have join dependency if it can be recreated by joining multiple
2 min read
First Normal Form (1NF)
If a table has data redundancy and is not properly normalized, then it will be difficult to handle and update the database, without facing data loss. It will also eat up extra memory space and Insertion, Update, and Deletion Anomalies are very frequent if the database is not normalized. Normalization is the process of minimizing redundancy from a r
3 min read
Minimum Relations Satisfying First Normal Form (1NF)
A relation that does not contain any composite or multivalued attribute, then the relation is in its First Normal Form. Relations that contain a single-valued attribute comes under First Normal Form. In this article, we will be going to discuss the minimum relations satisfying the First Normal Form. Before proceeding to First Normal Form, let's dis
4 min read
Third Normal Form (3NF)
Although Second Normal Form (2NF)relations have less redundancy than those in 1NF, they may still suffer from update anomalies. If we update only one tuple and not the other, the database will be in an inconsistent state. This update anomaly is caused by a transitive dependency. We need to remove such dependencies by progressing to the Third Normal
3 min read
How to find the highest normal form of a relation
To understand this topic, you should have a basic idea about Functional Dependency & Candidate keys and Normal forms .Steps to find the highest normal form of relation: Find all possible candidate keys of the relation.Divide all attributes into two categories: prime attributes and non-prime attributes.Check for 1st normal form then 2nd and so o
5 min read
What is Fifth Normal Form (5NF) in DBMS?
Normalization is a process that involves removing or decreasing the redundancy present in the database. Normalization mainly focuses on removing duplicate data from the database and making it more consistent. There are various types of normalization such as 1NF,2NF, 3NF, BCNF, 4NF, and 5NF. 5NF is one of the highest levels of normalization form pre
5 min read
Multivalued Dependency and Fourth Normal Form
In database management systems, normalization is an essential process to ensure that data is organized efficiently and effectively. Multivalued dependency (MVD) is a concept that helps to identify and eliminate data redundancy and anomalies, and Fourth Normal Form (4NF) is a normalization form that addresses the challenges associated with multivalu
5 min read
Second Normal Form (2NF)
First Normal Form (1NF) does not eliminate redundancy, but rather, it's that it eliminates repeating groups. Instead of having multiple columns of the same kind of data in a record, (0NF or Unnormalized form) you remove the repeated information into a separate relation and represent them as rows. This is what constitutes 1NF. Second Normal FormThe
4 min read
Converting Context Free Grammar to Greibach Normal Form
Context-free grammar (CFG) and Greibach Normal Form (GNF) are fundamental concepts in formal language theory, particularly in the field of compiler design and automata theory. This article delves into what CFG and GNF are, provides examples, and outlines the steps to convert a CFG into GNF. What is Context Free Grammar?Context-Free Grammar (CFG) is
6 min read
Types of Normal Forms in DBMS
Database normalization is nothing but the process of structuring an RDBMS by applying some general rules either by creating a new database design or by decomposition with a series of so-called normal forms which are: Unnormalized form or UNF First Normal Form or 1NF Second Normal Form or 2NF Third Normal Form or 3NF Elementary key normal form or EK
6 min read
Allowed Functional Dependencies (FD) in Various Normal Forms (NF)
Prerequisite - Functional Dependency and Attribute Closure We all know the following: 2 NF does not allow partial dependency.3NF does not allow transitive dependency.BCNF does not allow anything other than super key as determinant. Let’s check all possible functional dependencies to find out what is allowed and what’s not. Please note: prime attrib
2 min read
Normal Forms in DBMS
Normalization is the process of minimizing redundancy from a relation or set of relations. Redundancy in relation may cause insertion, deletion, and update anomalies. So, it helps to minimize the redundancy in relations. Normal forms are used to eliminate or reduce redundancy in database tables. Normalization of DBMSIn database management systems (
12 min read
Mathematics | Probability Distributions Set 3 (Normal Distribution)
The previous two articles introduced two Continuous Distributions: Uniform and Exponential. This article covers the Normal Probability Distribution, also a Continuous distribution, which is by far the most widely used model for continuous measurement. Introduction - Whenever a random experiment is replicated, the Random Variable that equals the ave
5 min read
Group Homomorphisms and Normal Subgroup
Bunch homomorphisms and typical subgroups are essential ideas in unique variable-based math that assume a pivotal role in grasping the construction and conduct of gatherings. A gathering homomorphism is a plan between two gatherings that safeguards the gathering activity, giving a method for concentrating on the connections and similarities between
15 min read
Normal and Principle Forms
Normal Forms are standardized formats for expressing logical formulas. They play a crucial role in simplifying and analyzing logical expressions, making it easier to apply logical reasoning, automated theorem proving, and other computational processes. Principal Forms are specific types of normal forms that are derived under certain conditions and
8 min read
Difference between Clausal form and Horn Clausal form in Deductive Database
1. Clausal form : In this form, the formula is made up of a number of clauses, where each clause is composed of a number of literals connected by OR logical connectives only. A clausal form formula must be transformed into another formula with the following characteristics : All variables in the formula are universally quantified. Hence, it is not
3 min read
ODBMS Full Form
ODBMS stands for Object Database Management System. In ODBMS data is encapsulated and represented in the form of objects. It relates the concept of object-oriented programming with database systems. ODBMS grew out of research during the early 1970s as database support for graph-structured objects. In comparison with RDBMS, where data is stored in t
2 min read
OSI Full Form
The Open System Interconnection (OSI) Reference Model was created as the first step towards the standardization of protocols by the International Standards Organization (ISO) in 1984. It is also called as the OSI Seven Layer Model as it divides the network architecture into seven distinct layers. Characteristics : The OSI model has layered architec
2 min read
Minimal to Canonical Form Conversion
Canonical Form is also called standard form, we directly obtained it from truth table and hence we have all the variable in normal or complimented form in each minterm. There are 3 steps for conversion of minimal form to canonical form. Find the Total Number of variable present in minimal form. Find the variables absent in each minterm. Try to appl
2 min read
RAG Full Form
RAG is the abbreviation for Resource Allocation Graph in operating systems. RAG is a directed graph which can be used to represent the state of a system in the form of picture. Deadlocks can be described more precisely in terms of a directed graph(RAG). The graph(V, E) consists a set of vertices which can be partitioned into two different types of
3 min read
SNMP Full Form
Simple Network Management Protocol (SNMP) is majorly used by the administrator to monitor the networking devices. Implementing this protocol would reduce the efforts to login to each of the devices and verify all the logs and ensures that the network is reliable at all times by informing the administrator about any suspicious logs/activity based on
3 min read
Clausal Form in Deductive Databases
In clausal form, the formula is made up of a number of clauses, where each clause is composed of a number of literals connected by OR logical connectives only. A formula can have the following quantifiers: Universal quantifier - It can be understood as - "For all x, P(x) holds", meaning P(x) is true for every object x in the universe. Example: All
2 min read
FIFO Full Form
FIFO stands for First In, First Out. FIFO is a type of data handling where element that is first to come will be first element to be processed. In technical terms, FIFO means that element which was stored as first element will befirst to be removed. It happens so because FIFO follows a queue type data structure. Thus, oldest element or element that
2 min read