0% found this document useful (0 votes)
54 views9 pages

Minimal and Canononical Cover

Uploaded by

sr8370759
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views9 pages

Minimal and Canononical Cover

Uploaded by

sr8370759
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

MINIMAL COVER :

In DBMS (Database Management Systems), a minimal cover (also known


as canonical cover) of a set of functional dependencies (FDs) is a
simplified or minimal representation of the functional dependencies that
still preserves the same closure of the original set. It is important in
database design, particularly in normalization, as it helps in eliminating
redundancy in FDs and ensures efficient database design.
A minimal cover satisfies the following conditions:
1. Each functional dependency is in the form A → B, where B is a single
attribute (right-hand side is a single attribute).
2. The left-hand side of each functional dependency is minimal,
meaning there are no extraneous attributes in the left-hand side.
3. Each functional dependency is essential, meaning no functional
dependency in the set can be removed without changing the closure
of the set of FDs.
Steps to find the minimal cover of a set of functional dependencies:
1. Break down multi-attribute right-hand sides: For every functional
dependency with multiple attributes on the right-hand side,
decompose it into multiple FDs, each with a single attribute on the
right-hand side. Example: If you have A → BC, split it into A → B and
A → C.
2. Remove extraneous attributes from the left-hand side: For each
functional dependency, check if an attribute in the left-hand side is
extraneous by temporarily removing it and checking whether the
dependency still holds (i.e., the closure remains the same). If yes,
remove that attribute from the left-hand side.
3. Remove redundant dependencies: Check if any functional
dependency can be removed without changing the closure of the set
of FDs. If removing a functional dependency doesn't affect the
closure, it is redundant and can be removed.
Example:
Consider the following set of functional dependencies:
F = { A → BC, B → C, A → B, AB → C }
Step 1: Break down multi-attribute right-hand sides
A → BC becomes A → B and A → C
F becomes: { A → B, A → C, B → C, AB → C }
Step 2: Remove extraneous attributes from the left-hand side
Check AB → C: Removing B from the left-hand side (i.e., A → C still
holds), so AB → C is redundant, and we can remove B.
Now F = { A → B, A → C, B → C }
Step 3: Remove redundant dependencies
Check if A → C is redundant: Since A → B and B → C imply A → C,
we can remove A → C.
Final minimal cover = { A → B, B → C }
2. Find the Minimal Cover
Given Functional Dependencies
 A -> B
 B -> C
 D -> ABC
 AC -> D
Step 1: Split the Functional Dependencies
 A -> B
 B -> C
 D -> A
 D -> B
 D -> C
 AC -> D
Step 2: Remove Redundant FDs
 A -> B (not redundant)
 B -> C (not redundant)
 D -> A (not redundant)
 D -> B (redundant, because D -> A and A -> B)
 D -> C (not redundant, as D -> B was removed)
 AC -> D (not redundant)
After removing redundancies FDs set became
 A -> B
 B -> C
 D -> A
 D -> C
 AC -> D
Step 3: Remove Extraneous Attributes
 In AC -> D, check if A or C is extraneous.
 Compute closures
 A+ = {A,B,C}
 C+ = {C}
 Since A alone does not give D, A is not extraneous
 Since C alone does not give D,C is not extraneous
So Minimal cover of (A -> B, B -> C, D -> ABC, AC -> D) => (A -> B,
B -> C, D -> A, AC -> D)
1. Verify if Two Sets of Functional Dependencies are Equivalent
Problem:
 F1 = { A → BC, B → C, A → B }
 F2 = { A → B, B → C }
 Are F1 and F2 equivalent?
Solution:
1. Find minimal cover of F1:
o A → BC becomes: A → B, A → C
o F1 = { A → B, A → C, B → C }
o No further simplification is possible.
2. Find minimal cover of F2:
o F2 = { A → B, B → C }
o No further simplification is possible.
3. Compare closures:
o Closure of A under F1: A⁺ = { A, B, C }
o Closure of A under F2: A⁺ = { A, B, C }
o Closure of B under both F1 and F2: B⁺ = { B, C }
o Therefore, F1 and F2 are equivalent.
2. Find the Minimal Cover After Adding a Functional Dependency
Problem:
 F = { A → B, B → C }
 A new FD: A → C
 Find the minimal cover of the updated set.
Solution:
1. Add the new FD to the set: F' = { A → B, B → C, A → C }.
2. Check if A → C is redundant:
o A → B and B → C together imply A → C (by transitivity).
o Hence, A → C is redundant.
3. Minimal cover:
o The minimal cover is the original set: { A → B, B → C }.
3. Remove an Attribute from a Relation and Find the New Minimal Cover
Problem:
 Relation R(A, B, C)
 FDs: { A → BC, B → C }
 Remove attribute C. What is the new minimal cover?
Solution:
1. Remove FDs involving attribute C:
o A → BC becomes A → B (since C is removed).
o B → C is removed entirely (since C no longer exists).
2. The new minimal cover:
o Minimal cover: { A → B }.
Find Minimal Cover for a Relation After Decomposition
Problem:
 Relation R(A, B, C, D) with FDs: { A → B, B → CD, A → C }
 Decompose R into R1(A, B) and R2(B, C, D).
Solution:
1. FDs in R1(A, B):
o A → B (only relevant FD for R1).
o Minimal cover for R1: { A → B }.
2. FDs in R2(B, C, D):
o FDs in R2 are: { B → C, B → D } (decompose B → CD into B →
C and B → D).
o Minimal cover for R2: { B → C, B → D }.
. Determine if a Given Set of FDs is Already Minimal
Problem:
 F = { AB → C, A → B, C → D }
 Is F a minimal cover?
Solution:
1. Check for single attribute on RHS:
o All FDs have a single attribute on the right-hand side (no need
to split FDs).
2. Check for extraneous attributes in LHS:
o AB → C: Remove A and check if B → C holds. B⁺ = { B }, so A
is not extraneous.
o AB → C is minimal.
3. Check for redundant FDs:
o No FD can be removed without changing the closure of F.
o The set F is already minimal.
6. Find Minimal Cover for a Set of FDs with Composite Left-Hand Side
Problem:
 F = { AB → C, AC → D, B → E }
 Find the minimal cover.
Solution:
1. Decompose FDs with multiple attributes on the RHS:
o FDs already have a single attribute on the RHS.
2. Check for extraneous attributes:
o AB → C: Remove A and check if B → C holds. B⁺ = { B, E }, so
A is necessary.
o AC → D: Remove A and check if C → D holds. C⁺ = { C }, so A
is necessary.
3. Check for redundant FDs:
o No FDs are redundant.
4. Minimal cover:
o Minimal cover is { AB → C, AC → D, B → E } (no change).

7. Find Minimal Cover After a Union of Two Relations


Problem:
 Relation R1(A, B) with FD: { A → B }
 Relation R2(B, C) with FD: { B → C }
 Combine R1 and R2 into R(A, B, C). Find the minimal cover.
Solution:
1. Combine the FDs of both relations:
F = { A → B, B → C }.
2. Check for redundancies:
o No FD is redundant.
3. Minimal cover:
o The minimal cover is { A → B, B → C } (no change).

8. Minimal Cover with Redundant FDs and Attributes


Problem:
 F = { A → BC, B → C, A → B, AB → C }
 Find the minimal cover.
Solution:
1. Decompose multi-attribute RHS:
o A → BC becomes A → B and A → C.
o F = { A → B, A → C, B → C, AB → C }.
2. Remove extraneous attributes:
o AB → C: Remove B and check if A → C holds. A → C already
exists, so AB → C is redundant.
3. Remove redundant FDs:
o A → C is already implied by A → B and B → C (by transitivity).
o Remove A → C.
4. Minimal cover:
o The minimal cover is { A → B, B → C }.
9. Find Minimal Cover After Normalization
Problem:
 Given relation R(A, B, C) with FDs: { A → B, B → C, A → C }.
 Normalize the relation and find the minimal cover.
Solution:
1. Normalize to 3NF/BCNF:
o The relation is already in 3NF (since every FD is either trivial
or the LHS is a superkey).
o No need for further decomposition.
2. Find the minimal cover:
o Remove redundant FDs. A → C is redundant because A → B
and B → C imply A → C.
o Minimal cover: { A → B, B → C }.

CANONICAL FORM:
Canonical form in DBMS refers to the standardized representation of
functional dependencies (FDs). Specifically, every FD in the canonical form
has a single attribute on the right-hand side (RHS), and no FD is
redundant or contains any extraneous attributes. Here are some problems
involving the conversion to and use of canonical forms.
1. Convert a Set of FDs to Canonical Form
Problem:
Given the following set of functional dependencies, convert them into
canonical form:
 F = { A → BC, B → CD, A → D }.
Solution:
1. Split each FD with multiple attributes on the RHS:
o A → BC becomes A → B, A → C.
o B → CD becomes B → C, B → D.
The canonical form:
o Canonical form: { A → B, A → C, B → C, B → D, A → D }.
2. Determine if a Given Set of FDs is in Canonical Form
Problem:
Determine if the following set of functional dependencies is in canonical
form:
 F = { A → B, AB → C, C → DE }.
Solution:
1. Check if each FD has a single attribute on the RHS:
o A → B: Single attribute on the RHS, no need to split.
o AB → C: Single attribute on the RHS, no need to split.
o C → DE: Multiple attributes on the RHS, need to split into:
 C → D, C → E.
2. The new set in canonical form:
o Canonical form: { A → B, AB → C, C → D, C → E }.
3. Convert FDs to Canonical Form and Find Closure
Problem:
Given FDs: F = { A → B, B → CD, D → E }, convert them to canonical form
and find the closure of { A }.
Solution:
1. Convert to canonical form:
o B → CD becomes B → C, B → D.
Canonical form: { A → B, B → C, B → D, D → E }.
2. Find the closure of { A }:
o A⁺ = { A }.
o Using A → B, A⁺ = { A, B }.
o Using B → C, A⁺ = { A, B, C }.
o Using B → D, A⁺ = { A, B, C, D }.
o Using D → E, A⁺ = { A, B, C, D, E }.
Closure of { A } = { A, B, C, D, E }.
Problem:
Consider a set of Functional dependencies: 𝐹={𝐴→𝐵𝐶,𝐵→𝐶,𝐴𝐵→𝐶}.
Here are the steps to find the canonical cover –
Step 1:Decompose FDs to have a single attribute on the right-hand side
 𝐴→𝐵𝐶 becomes 𝐴→𝐵 and 𝐴→𝐶.
 Therefore, we have {𝐴→𝐵, 𝐴→𝐶, 𝐵→𝐶, 𝐴𝐵→𝐶}.
Step 2:Remove extraneous attributes from the left-hand side of FDs
 Checking 𝐴𝐵→𝐶: First, check if 𝐴 or 𝐵 is extraneous.
We can reach 𝐶 without using 𝐴𝐵→𝐶 with other functional
dependencies; therefore, we remove 𝐴𝐵→𝐶.

 Finally, we have {𝐴→𝐵, 𝐴→𝐶, 𝐵→𝐶}.


Step 3:Remove redundant FDs

without using it. For example, 𝐴→𝐶 can be reached with 𝐴→𝐵 and
 Check each functional dependency to see if it can be reached

𝐵→𝐶. Therefore, 𝐴→𝐶 is redundant and can be removed.


 Hence, Canonical Cover = {𝐴→𝐵, 𝐵→𝐶}.

You might also like