DBMS - Minimal Cover



In database management systems (DBMS), a minimal cover (or irreducible set) is a simplified version of a given set of functional dependencies. It preserves the original meaning but eliminates redundancies and unnecessary complexities. One needs to learn the process of finding a minimal cover for database normalization. It helps in creating efficient and well-structured tables.

In this chapter, we will explain the concept of minimal cover in simple steps, and see the process with an example for a better understanding.

What is Minimal Cover in Functional Dependency?

A minimal cover of a set of functional dependencies is an equivalent set that satisfies these conditions −

  • The right-hand side (RHS) of every functional dependency has exactly one attribute.
  • No functional dependency will be redundant.
  • The left-hand side (LHS) of every functional dependency is as small as possible. It means we cannot remove any attribute without losing the dependency.

With these conditions, a minimal cover helps us in simplifying the design while retaining the same functional relationships as the original set.

Steps to Find Minimal Cover

Let us now understand how to find the minimal cover. To compute the minimal cover, we follow three key steps

  • Decompose the RHS − It shows that every functional dependency has only one attribute on its RHS.
  • Remove Redundant Functional Dependencies − Check and eliminate any dependencies that are not needed.
  • Minimize the LHS − Simplify the LHS of each dependency by removing unnecessary attributes.

Let us get a good understanding of these steps see these steps down further with an example.

Example: Finding the Minimal Cover

Suppose we are given the following functional dependencies −

  • A → B
  • C → B
  • D → A, B, C
  • AC → D

We aim to find the minimal cover for this set.

Step 1: Decompose the RHS

First, we make sure that each functional dependency has only one attribute on its RHS. This is done using the decomposition property.

  • A → B: This is already in the correct form. It has the RHS has a single attribute.
  • C → B: Again, this is fine as is.
  • D → A, B, C: Here, the RHS has three attributes. We decompose it into three separate dependencies:
    • D → A
    • D → B
    • D → C
  • AC → D: The RHS has one attribute. So it remains unchanged.

After Step 1, our updated set of dependencies looks like this −

  • A → B
  • C → B
  • D → A
  • D → B
  • D → C
  • AC → D

Step 2: Remove Redundant Dependencies

Next, we check each functional dependency. To see if it is redundant. A dependency is redundant if it can be removed without changing the meaning of the set. This shows finding closures and verifying if the dependent attribute can still be determined without the removed dependency.

  • Check A → B − Remove A → B and calculate the closure of A using the remaining dependencies. The closure of A only includes A. Since B is not in the closure, A → B is not redundant and must be kept.
  • Check C → B − Remove C → B and calculate the closure of C. The closure of C only includes C. So B cannot be determined. Thus, C → B is not redundant and must be kept.
  • Check D → A − Remove D → A and calculate the closure of D. The closure of D includes D, B, C, but A cannot be determined without this dependency. Therefore, D → A is not redundant and must stay.
  • Check D B − Remove D → B and calculate the closure of D. The closure of D still includes B. So D → B is redundant and can be removed.
  • Check D → C − Remove D → C and calculate the closure of D. The closure of D does not include C, so D → C is not redundant and must stay.
  • Check AC → D − Remove AC → D and calculate the closure of AC. Without AC → D, D cannot be determined. So this dependency is not redundant and must stay.

After Step 2, the updated set of dependencies is −

  • A → B
  • C → B
  • D → A
  • D → C
  • AC → D

Step 3: Minimize the LHS

In the final step, we minimize the LHS of each dependency. It involves removing attributes from the LHS if they are not needed to determine the RHS.

Minimize AC → D

Check if either A or C can be removed from the LHS.

  • Remove A and calculate the closure of C. The closure of C does not include D, so A cannot be removed.
  • Remove C and calculate the closure of A. The closure of A also does not include D, so C cannot be removed.

Thus, AC → D remains as is.

All other dependencies already have a single attribute on the LHS. So, no further minimization is needed.

Final Minimal Cover

The minimal cover for the given functional dependencies is −

  • A → B
  • C → B
  • D → A
  • D → C
  • AC → D

Importance of Minimal Cover

Minimal cover is needed because it simplifies the set of functional dependencies while maintaining their original meaning. It helps in −

  • Avoiding redundant computations.
  • Reducing the complexity of database design.
  • Making normalization easier.

By ensuring that both the LHS and RHS of dependencies are as simple as possible, the minimal cover aids in creating efficient and well-organized databases.

Conclusion

In this chapter, we explained how to find the minimal cover of a set of functional dependencies. We understood its purpose and importance in database normalization.

We broke the process into three clear steps: decomposing the RHS, removing redundant dependencies, and minimizing the LHS. Using a detailed example, we applied these steps to arrive at the minimal cover for a set of functional dependencies.

Advertisements