×

BCNF in DBMS

BCNF stands for Boyce–Codd Normal Form.

What is the Normal form?

The normal form is mainly used to reduce the redundancy of the database tables.

Or we can say that the normal form is a step-by-step process and each step is known as the normal form.

In other words, the normal form is a stage at which we organize the database tables.

There is a different types of normal forms:

  • 1NF( First normal form)
  • 2NF( Second normal form)
  • 3NF( Third normal form)
  • BCNF( Boyce-Codd normal form)

What is Normalization?

Normalization is a process in the database management system that is used to organize the data with its attributes and it also performs data redundancy to check if the data is stored logically or not.

What is BCNF (Boyce-Codd Normal Form)?

BCNF is known as Boyce-Codd Normal Form, it is a special case of 3NF (normal form) and we can also say that it is also known as 3.5 NF. A relation to BCNF (Boyce-Codd normal form) exists if and only if the determinants are candidate key.

Or we can say that BCNF is a normal form in the normalization of databases and its rules are stricter than the 3 NF. It is based on the functional dependencies that take all the determinants of all candidate keys in a relationship.

As we all know, the third normal form doesn’t remove all the redundancy from the database tables in cases where a functional dependency says that B->C, in this case, B is not a candidate key of the database table. BCNF was introduced to deal with such situations.

A table is said to be in form of BCNF if the table is already in the form of the third normal form (3NF) in the DBMS.

And we also know that for every functional dependency, we should have an attribute in the from of candidate keys, let's say (A->B), A is either the super key or the candidate key. In the simple words, for any case, A cannot be a non-prime attribute.

Some Rules for BCNF in DBMS

Suppose, we want to check if the table satisfies the conditions of BCNF, then we need to follow two conditions as follows:

  • First, the table should be in the form of the third normal form (3 NF).
  • For any dependency A→B, in this A must be a super key or a candidate key. In other words, for the function dependency A→ B, if B is a prime attribute of the table, then A cannot be a non-prime attribute of the table.

In the state of 3NF, the transitive dependency must not exist. Transitive dependency is known as the Left-hand side (LHS) of the functional dependency.

It must contain a super key or the candidate key or functional dependency right-hand side (RHS) should be a prime attribute.

Example of BCNF in DBMS

Example 1:

Suppose we have a hospital table where the employees work in more than one department.

EMPLOYEE TABLE

EMP_IDNATIONALITYEMP_DEPTDEPT_TYPEDEPT_NO
E001IndiaSurgeryX12301
E002CanadaDentalX12402
E001IndiaGeneral MedicineX97212
E004PakistanRadiologyX97356

Functional dependencies of this table:

  • EMP_ID → Nationality
  • EMP_DEPT → {DEPT_TYPE, DEPT_NO}

Candidate key of this table:

  • {EMP_ID, EMP_DEPT}

In this example, the table is not BCNF form as both EMP_ID and EMP_DEPT alone are not keys. If we want to convert this table into BCNF form, we need to decompose the table into three tables based on the functional dependency of the table.

NATIONALITY TABLE

EMP_IDNATIONALITY
E001India
E002Canada
E004Pakistan

DEPT TABLE

EMP_DEPTDEPT_TYPEDEPT_NO
SurgeryX12301
DentalX12402
General MedicineX97212
RadiologyX97356

DEPT Mapping table

EMP_IDEMP_DEPT
E001Surgery
E002Dental
E001General Medicine
E004Radiology

Functional dependencies

  • EMP_ID → Nationality
  • EMP_DEPT→ {DEPT_TYPE, DEPT_NO}

Candidate key

  • Nationality Table: EMP_ID
  • DEPT Table: EMP_DEPT
  • DEPT Mapping Table: {EMP_ID, EMP_DEPT}

The relation is now in BCNF form because it satisfies both conditions which are that the table is already in 3NF form and on the LHS of the functional dependency there is a candidate key.

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

EMPLOYEE TABLE

EMP_IDEMP_COUNTRYEMP_DEPTDEPT_TYPEEMP_DEPT_NO
250IndiaITD395183
250IndiaDigital MarketingD395200
362PakistanStoresD284132
362PakistanDevelopingD284449

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_IDEMP_COUNTRY
250India
250India

EMP_DEPT table:

EMP_DEPTDEPT_TYPEEMP_DEPT_NO
ITD395183
Digital MarketingD395200
StoresD284132
DevelopingD284449

EMP_DEPT_MAPPING table:

EMP_IDEMP_DEPT
250IT
250Digital Marketing
362Stores
362Developing

Functional dependencies:

  1. EMP_ID   →    EMP_COUNTRY  
  2. 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.


Related Topics

Query processing in DBMS

Operations on DBMSs are made much simpler, more organized, and methodical with SQL. These are not only simpler for people to comprehend, but after gaining a basic comprehension of them, they...

4 minutes read.

Levels of Locking in DBMS

There are several levels of locks that can control the access to the elements stored at various levels in the Database. There can be multiple levels of the locks. These...

6 minutes read.

Database for library management system

The database can be considered the container where the data or information can be stored electronically in a computer system. Most mobile applications and websites run our day-to-day activities by...

5 minutes read.

Conversion of ER Diagram into Relational Model

After designing the Entity-Relationship diagram, you need to convert it into tables in the relational model. Because the relational model can be easily implemented by the Relational DBMS like Oracle, MySQL, etc....

2 minutes read.

DBMS Architecture

Architecture of Database Management System DBMS architecture helps in development, implementation, design, and maintenance of a database that store and organize information for agencies, businesses, and institutions. It is the base of any database...

2 minutes read.

Cardinality in DBMS

Cardinality in DBMS Cardinality is the relationship between two or more entities (table). It shows how all the entities are connected. In DBMS, all the entities and tables are interconnected with...

2 minutes read.

Primary Key in DBMS

Primary Key in DBMS: A primary key is the minimal set of columns in the database table, which uniquely identifies each row or tuple in that table. Any table in...

2 minutes read.

States of Transaction in DBMS

Transaction States A transaction passes through many different states in its life cycle. These states are known as transaction states. A transaction can be in one of the following states in the database: Active statePartially...

3 minutes read.

DBMS Generalization, Specialization, and Aggregation

DBMS Generalization Generalization is a bottom-up approach in which the common attributes of two or more lower-level entities combines to form a new higher-level entity. In generalization, the generalized entity of higher level can also...

3 minutes read.

Er Diagram Symbols and Notations in DBMS

Entity Relationship Diagram Entity Relationship Diagrams, or ER Diagrams for short, are diagrams that show the relationships among entity sets that are stored in databases. Alternatively said, ER diagrams assist in...

6 minutes read.

What is a Cloud Database

Cloud computing is the process of commoditizing data storage and processing time using standardized technologies. Cloud databases are databases that are hosted on cloud computing platforms such as Salesforce, GoGrid,...

4 minutes read.

DBMS Schedule

A schedule is a process of combining the multiple transactions into one and executing the operations of these transactions in a predefined order. A schedule can have multiple transactions in it, each transaction...

2 minutes read.

ER Diagram for Banking System in DBMS

Entity Relationship Diagram Entity Relationship Diagrams, or ER Diagrams for short, are diagrams that show the relationships among entity sets that are stored in databases. Alternatively said, ER diagrams assist in...

3 minutes read.

Advantages of RDBMS

The relational database management system collects related data stored in tabular format. The data is stored in rows and columns, where rows usually represent the individual entity of the collected...

6 minutes read.

DBMS Keys: Primary, Super, Candidate, Foreign

In database management system, keys play an important role which is used for identifying unique records by the combination of one or more fields in the database table. Keys also allows you to...

3 minutes read.

DBMS Schema

Schema It is a physical representation of data that appears in the database management system. In simple words, a schema is the structure of any database.It defines how the data is stored...

2 minutes read.

Levels of Abstraction in DBMS

Data abstraction is a way to hide unwanted or irrelevant information from the end user in DBMS. It helps in enhancing the security of data, and simplifies database design using...

4 minutes read.

Functional Dependencies

Functional Dependencies (FD) in the relational database management system occurs when one attribute in a relation uniquely determines other attribute in that relation. It describes the relation between the attributes. The term functional...

2 minutes read.

Hashing in DBMS: Static and Dynamic

Hashing in DBMS: Hashing is the technique of the database management system, which directly finds the specific data location on the disk without using the concept of index structure. In the...

4 minutes read.

Difference between Relational and Non-Relational Databases

Databases have become an integral part of our lives, from powering big websites like Amazon and Netflix to everyday tasks like remembering our passwords. With such an indispensable role in...

7 minutes read.