Disclaimer: This is a user generated content submitted by a member of the WriteUpCafe Community. The views and writings here reflect that of the author and not of WriteUpCafe. If you have any complaints regarding this post kindly report it to us.

In this tutorial we are going to learn:

  • Canonical covers in functional dependencies 
  • In-depth details on this concept 
  • How to find canonical cover in dbms?

And, a lot more! 

Canonical cover is an essential dbms concept alongside other concepts like its working, categorization, levels of abstraction in dbms  and much more!

In the canonical cover, whenever a user updates his database, the system checks for all functional dependencies if it is being violated in the process. Though, if there is any violation, the system may roll back. 

Though, it may also cause unnecessary computations. This is when canonical cover in dbms comes as a savour. 

It is a set of all functional dependencies denoted by  F with the same closure as its original set. 

Learn the nits and grits of this concept with the help of this blog post! 

So without any further ado, let’s get started! 

 

Functional Dependencies

Firstly you should know what functional dependencies are? 

This is defined as a constraint with two sets of the attributes that are related to your database. Any functional dependency can be denoted by []. This determines the value that may be written as AB.

The attribute A is written to determine the attribute B which is written as AB. 

  • Trivial functional dependency: The functional dependency AB would be trivial if only its B is the subset of A 

ABC →A

AB  → B

ABC  → ABC

  • Non-trivial functional dependency: AB will be the functional dependency if B will not be the subset of its A. This can be completely non-trivial or null
  • Semi Non-trivial dependency: AB in this case will be non-trivial where it is NULL. 

 

What is a Canonical Cover in DBMS?

In case of the updation of your database, the responsibility of your system would be to check if the existing database functional dependencies are being violated in the updating process or not. 

In case, there is any violation of functional dependencies in the database system, the system’s rollback may take place. Though, a canonical cover is a kind of irreducible set of the functional dependencies with the functional set with the similar course of the functional dependencies. 

 

Important terms to consider

Extraneous attributes: In this case, if we will delete any attribute of the functional dependency without doing any kind of modification it will give the closure of the set of your functional dependencies. Though, this may be an unnecessary thing to do in this case.

Canonical cover: Fc would be the canonical cover with the certain set of your functional dependencies F in a way that the below-mentioned properties will not be violated:

  • All the dependencies in the case of Fc will be logically implied by the F
  • All the dependencies in the respective F gets logically implied by the Fc
  • There will not be an extraneous attribute in the case of Fc functional dependency
  • Each of the functional dependencies left will be Fc in the distinct. 

 

Extraneous attribute 

Let’s look at the extraneous attributes in-depth. There is an attribute FD which will be considered as the extraneous if we will remove it without the closure of the set FD

Consider the following example;

A relational schema R is given to you with A, B , C , D. Also, the set of functional dependencies FD would be [ B  → A, AD  →

 BC , C  → ABD]

Here, you need to find its canonical cover

 

Solution Approach 

FD = [ B  → A, AD  → BC, C  → ABD ]

We can now decompose our FD with the decomposition or the Armstrong axiom rule. 

 

B  → A 

 

AD  → B [ With the decomposition rule on the AD  → BC]

 

AD  → C [ With the decomposition inference rule on the AD  → BC]

 

C  → A [ With the decomposition inference on rule C  → ABD]

 

C  →B  [ With the decomposition inference rule C  → ABD]

 

C  → D [ With the decomposition inference rule C  → ABD]

 

You have to find the closure on the left side for each given FD by including or excluding that particular FD, if the closure in both the cases will be the same. Then your FD would be redundant and we will remove the FD from our given set. Otherwise, for both the closures, the set would be different if we are not excluding that FD from it. 

 

Consider another set of problem:

Find Canonical cover FD [ A -> BC, B -> AC, C ->AB]

 

Solution:

Here the relational schema, R [ A, B, C] with F [ A – > BC, B – > AC, C -> AB]

 

Step 1 

First create the right side dependency A -> BC by breaking it into A – > B , A -> C 

 

Step 2 

Remove all the extraneous attributes existing in it

 

Step 3 

Remove the redundant functional dependencies

Remove B – >A , we will get A through B ->C, C->A 

By removing C -> B dependency, we can get it from B from C through C -> A, A -> B 

By removing the C ->B dependency, we can get it from B till C through the C ->A , A ->B 

By removing the A -> C dependency, we can easily determine C from the A with the help of A ->B and B->C

 

Step 4: In this case, the final canonical cover in the following;

FC = [ A – > B, B -> C, C -> A ]

[ A] + = BC 

[ B] + = AC 

[ C] + = AB 

 

How does canonical cover work in the case of DBMS?

A canonical cover will be the set of functional dependencies Fd with that of the satisfaction of the following properties:

  • A functional dependence or Fd as per the rules of the canonical cover Cc
  • Canonical cover as per the rules will apply to the functional dependencies
  • In canonical there will be no functional dependencies which will be irrelevant 

 

Wrapping up 

We hope that this guide has given you adequate knowledge regarding the concept of canonical cover in dbms. This is a crucial dbms concept.

Though, you can learn other, crucial database concepts like its fundamentals, working, levels of abstraction in dbms and much more. 

Happy learning!


Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Warning: array_key_exists() expects parameter 2 to be array, string given in /home2/writeup/public_html/wp-content/plugins/jet-popup/includes/settings.php on line 126

Login

Welcome to WriteUpCafe Community

Join our community to engage with fellow bloggers and increase the visibility of your blog.
Join WriteUpCafe