Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Notes  >  Database Management System (DBMS)  >  Canonical Cover of Functional Dependencies in DBMS

Canonical Cover of Functional Dependencies in DBMS | Database Management System (DBMS) - Computer Science Engineering (CSE) PDF Download

Introduction

Whenever a user updates the database, the system must check whether any of the functional dependencies are getting violated in this process. If there is a violation of dependencies in the new database state, the system must roll back. Working with a huge set of functional dependencies can cause unnecessary added computational time. This is where the canonical cover comes into play.
A canonical cover of a set of functional dependencies F is a simplified set of functional dependencies that has the same closure as the original set F.

Important definitions


Extraneous attributes: An attribute of a functional dependency is said to be extraneous if we can remove it without changing the closure of the set of functional dependencies.

Canonical cover: A canonical cover F_{c} of a set of functional dependencies F such that ALL the following properties are satisfied:

  • F logically implies all dependencies in Fc.
  • Fc logically implies all dependencies in F.
  • No functional dependency in Fc contains an extraneous attribute.
  • Each left side of a functional dependency in Fc is unique. That is, there are no two dependencies α1 → β1 and α2 → β2 in such that α1 → α2.

Finding Canonical Cover

Algorithm to compute canonical cover of set F:
repeat

  1. Use the union rule to replace any dependencies in α1 →β1 and α1 → β2 with α→ β1β2.
  2. Find a functional dependency α → β with an extraneous attribute either in α or in β.
  3. If an extraneous attribute is found, delete it from α → β. until F does not change

Example 1:
Consider the following set F of functional dependencies:
F = {
A → BC
B → C
A → B
AB → C
}
Steps to find canonical cover:

  1. There are two functional dependencies with the same set of attributes on the left:
    A→ BC
    A → B
    These two can be combined to get
    A → BC.
    Now, the revised set F becomes:
    F = {
    A → BC
    B → C
    AB → C
    }
  2. There is an extraneous attribute in AB → C because even after removing AB → C from the set F, we get the same closures. This is because B → C is already a part of F.
    Now, the revised set F becomes:
    F = {
    A → BC
    B → C
    }
  3. C is an extraneous attribute in A → BC, also A → B is logically implied by A → B and B → C (by transitivity).
    F = {
    A → B
    B → C
    }
  4. After this step, F does not change anymore. So,
    Hence the required canonical cover is,
    F= {
    A → B
    B → C
    }

Example 2:
Consider another set F of functional dependencies:
F = {
A → BC
CD → E
B → D
E → A
}

  1. The left side of each functional dependency in F is unique.
  2. None of the attributes in the left or right side of any functional dependency is extraneous (Checked by applying definition of extraneous attributes on every functional dependency).
  3. Hence, the canonical cover Fc is equal to F.

Note: There can be more than one canonical cover Fc of a set F of functional dependencies.

How to check whether a set of f.d.’s F canonically cover another set of f.d.’s G?
Consider the following two sets of functional dependencies:
F = {
A → B
AB → C
D → AC
D → E
}
G = {
A → BC
D → AB
}
Now, we are required to find out whether one of these f.d.’s canonically covers the other set of f.d.’s. This means, we need to find out whether F canonically covers G, G canonically covers F, or none of the two canonically cover the other.

To find out, we follow the following steps:

  • Create a singleton right hand side. This means, the attributes to the right side of the f.d. arrow should all be singleton.
    The functional dependency D→ AC gets broken down into two functional dependencies, D → A and D → C.
    F = {
    A → B
    AB → C
    D → A
    D → C
    D → E
    }
  • Remove all extraneous attributes.
    Consider any functional dependency XY → Z. If X in itself can determine Z, then the attribute Y is extraneous and can be removed. As we can see, the occurrence of extraneous attributes is possible only in those functional dependencies where there are more than one attributes in the LHS.
    So, consider the functional dependency AB → C.
    Now, we must find the closures of A and B to find whether any of these is extraneous
    A+= AB
    B+= B
    As we can see, B can be determined from A. This means we can remove B from the functional dependency AB → C.
    F = {
    A → B
    A → C
    D → A
    D → C
    D → E
    }
  • Remove all redundant functional dependencies.
    Check all f.d.’s one by one, and see if by removing a f.d. X → Y, we can still find out Y from X by some other f.d. A more formal way to state this is find [X]^{+} without making use of the f.d. we are testing and check whether Y is a part of the closure. If yes, then the f.d. is redundant.
    Here, when checking for the f.d. D → C, we observe that even after hiding it, the closure of D contains C. This is because we can obtain C from D by the combination of two other f.d.’s D → A and A→ C. So, → C is redundant.
    F = {
    A → B
    A → C
    D → A
    D → E
    }

Now, do the same for G.

  • Create a singleton right hand side. This means, the attributes to the right side of the f.d. arrow should all be singleton.
    G = {
    A → B
    A → C
    D → A
    D → B
    }
  • Remove all extraneous attributes.
    Since the RHS of all f.d.’s contains only 1 attribute, there is no extraneous attribute possible.
  • Remove all redundant functional dependencies.
    By looping over all f.d.’s and checking the closure of the LHS in all cases, we observe that the f.d. D → B is redundant as it can be obtained through a combination of 2 other f.d.’s, D → A and A → B.
    G = {
    A → B
    A → C
    D → A
    }

Now, since all f.d.’s of G are already covered in F, we conclude that F covers G.

The document Canonical Cover of Functional Dependencies in DBMS | Database Management System (DBMS) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Database Management System (DBMS).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
62 videos|66 docs|35 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Canonical Cover of Functional Dependencies in DBMS - Database Management System (DBMS) - Computer Science Engineering (CSE)

1. What is the concept of canonical cover in functional dependencies?
Ans. Canonical cover refers to the minimal set of functional dependencies that is equivalent to the original set of dependencies. It eliminates redundant dependencies and ensures that all the remaining dependencies are necessary to preserve the same information.
2. How is the canonical cover helpful in database management systems (DBMS)?
Ans. The canonical cover is helpful in DBMS as it simplifies the process of normalization by identifying the minimal set of functional dependencies. It ensures that the database design is free from redundancy, improving data integrity and reducing storage space requirements.
3. What steps are involved in finding the canonical cover of functional dependencies?
Ans. The steps for finding the canonical cover are as follows: 1. Start with the given set of functional dependencies. 2. Eliminate redundant dependencies by removing any dependency that can be derived from the remaining dependencies. 3. Break down any dependencies with multiple attributes on the right-hand side into individual dependencies. 4. Combine any dependencies with the same left-hand side. 5. Repeat steps 2-4 until no further changes can be made.
4. How does the canonical cover contribute to database optimization?
Ans. The canonical cover contributes to database optimization by eliminating redundant dependencies. Redundant dependencies can lead to data anomalies and unnecessary storage requirements. By identifying the minimal set of dependencies, the canonical cover helps optimize the database structure, improving query performance and reducing storage space.
5. What is the significance of functional dependencies in database design?
Ans. Functional dependencies are significant in database design as they define the relationships between attributes in a database table. They ensure data integrity by specifying the rules that must be followed when updating or inserting data. Functional dependencies form the basis for normalization, which is essential for creating a well-structured and efficient database schema.
62 videos|66 docs|35 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

past year papers

,

Previous Year Questions with Solutions

,

Canonical Cover of Functional Dependencies in DBMS | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

Semester Notes

,

Important questions

,

Objective type Questions

,

pdf

,

study material

,

video lectures

,

shortcuts and tricks

,

Viva Questions

,

MCQs

,

Canonical Cover of Functional Dependencies in DBMS | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

ppt

,

Sample Paper

,

Extra Questions

,

Free

,

Exam

,

Canonical Cover of Functional Dependencies in DBMS | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

Summary

,

mock tests for examination

,

practice quizzes

;