## To find Extraneous attribute in a given functional dependency / How to find extraneous attribute? / Example for finding extraneous attributes

## Finding Extraneous Attributes

Let us consider a set of functional
dependencies F and any functional dependency of the form Î± → Î². Assume
that Î± and Î² are
set of one or more attributes. [For example, A →
BC or AB →
CE etc.]

**: To find if an attribute A in Î± is extraneous or not. That is, to test if an attribute of Left Hand Side of a functional dependency is Extraneous or not.**

*Case 1 (LHS)***Step 1**: Find ({Î±} – A)

^{+}using the dependencies of F.

**Step 2**: If ({Î±} – A)

^{+}contains all the attributes of Î², then A is extraneous.

**: To find if an attribute A in Î² is extraneous or not. That is, to test if an attribute of Right Hand Side of a functional dependency is Extraneous or not.**

*Case 2 (RHS)***Step 1**: Find Î±

^{+}using the dependencies in F’ where F’ = (F – {Î± → Î²}) U { Î± → (Î² – A) }.

**Step 2**: If Î±

^{+}contains A, then A is extraneous.

###
**Example 1 for LHS:**

**Example 1 for LHS:**

Given F = {P→Q,
PQ→R}.
Is Q extraneous in PQ→R?

In this example, we are looking
for a LHS attribute. Hence, let us use Case 1 discussed above.

*Step 1: Find ({*

*Î±*

*} – A)*

^{+}using the dependencies of F.
Here,
Î±
is PQ. So find (PQ – Q)

^{+}, ie., P+ (closure of P).
From
F, if you know P, then you know Q (from P→Q).

If
you know both P and Q then you know R (from PQ→R).

Hence,
the closure of P is PQR.

*Step 2: If ({*

*Î±*

*} – A)*

^{+}contains all the attributes of*Î²*

*, then A is extraneous.*

(PQ
– Q)

^{+}contains R. Hence, Q is extraneous in PQ→R.###
**Example 2 for RHS:**

**Example 2 for RHS:**

Given F = {P→QR,
Q→R}.
Is R extraneous in P→QR?

In this example, we are looking
for a RHS attribute. Hence, let us use the Case 2 given above.

Step 1: Find Î±

^{+}using the dependencies in F’ where F’ = (F – {Î± → Î²}) U { Î± → (Î² – A) }.
Let
us find F’ as stated above.

F’
= (F – {Î± → Î²}) U { Î± → (Î² – A) }
= ({P→QR, Q→R}
– {P→QR})
U {P→(QR-R)}

= ({Q→
R} U {P→Q})

F’ = {Q→R,
P→Q}

Here,
Î±
is P. So find (P)

^{+}, ie., closure of P using the F’ which we found.
From
F’, if you know P, then you know Q (from P→Q).

If
you know Q then you know R (from Q→R).

Hence,
the closure of P is PQR.

Step 2: If Î±

^{+}contains A, then A is extraneous.
P+
contains R. Hence, R is extraneous in P→QR.

Did you mean to say F' in example 2 step 1 when you said "from F, if you know P, then you know Q"?

ReplyDeleteThanks for your comment. Now I have changed to F' in example 2.

DeleteHere is a list of functional dependencies:

ReplyDeleteABC → D

CDE → F

DE → A

DE → B

CF → B

BDF → E

AE → C

BC → F

AB → E

AB → F

BF → C

Find ALL minimal covers for this set of FD's.

how to find for this?

Hi, please try these pages to find an answer. If you are not able to solve, please comment. Thanks.

Deletehttp://www.exploredatabase.com/2016/12/canonical-cover-or-minimal-cover-in-dbms-home-page.html

http://www.exploredatabase.com/2017/10/minimal-cover-canonical-cover-solved-exercises.html

this is what I could come up

DeleteAB -> DE

DE ->ABF

CF -> B

BDF ->E

AE → C

BC → F

BF → C

Since I dont know how to validate.. Can you think of any other minimal cover set?

This is the minimal cover;

ReplyDeleteAB->DF, DE->AB, CF->B, BDF->E, AE->C, BC->F, BF->C