Friday, August 29, 2014

Finding Extraneous Attribute in DBMS


Finding Extraneous Attributes in DBMS / How to find extraneous attributes in the process of Normalization? / Finding Extraneous Attributes Examples / Extraneous attribute finding as part of finding Canonical cover



Extraneous Attribute

If we are able to remove an attribute from a functional dependency without changing the closure of the set of functional dependencies, that attribute is called as Extraneous Attribute.
[Dictionary meaning of ‘Extraneous’ is ‘irrelevant’, ‘inappropriate’, or ‘unconnected’]
Assume a set of functional dependencies F, and the closure of set of functional dependencies F+. Also, assume that we remove an attribute from any of the FDs under F and find the closure of new set of functional dependencies. Let us mention the new closure of set of functional dependencies as F1+.  If F+ equals the newly constituted closure F1+, then the attribute which has been removed is called as Extraneous Attribute. In other words, that attribute does not violate any of the functional dependencies.

Example 1:

Let us consider a relation R with schema R(A, B, C) and set of functional dependencies F = { AB C, A C }. The closure for F is F+ = { AB C, A C }.
In AB C, B is extraneous attribute. The reason is, there is another FD A C, which means when A alone can determine C, the use of B is unnecessary (redundant).
Now, we can find the closure for the new set of functional dependencies, which is same as F+. Hence, we can declare that B is extraneous.

Example 2:

Let us consider a relation R with schema R(A, B, C, D) and a set of functional dependencies F = { A BC, B C, AB → D }. What extraneous attributes are present in FDs of F?
C is extraneous in the RHS (Right Hand Side) of A BC. Because, A can determine B (A BC), B can determine C (B C). Hence, A can determine C also (Transitivity rule). Hence, it is inappropriate to repeat or check an attribute many times.
B is extraneous in the LHS of AB D. The reason is, from A BC, it is clear that A determines B. it would indirectly mean that if you know A and B then you know D also.

Formal definition of Extraneous Attribute

In a set of functional dependencies F, consider a functional dependency α → β.
Attribute A is extraneous in α, if A α, and F logically implies (F − {α β}) {(α − A) β}.
Attribute A is extraneous in β, if A β, and the set of functional dependencies
(F − {α β}) (β − A)} logically implies F.

For example, suppose F contains AB CD, A E, and E C. To check if C is extraneous in AB CD, we compute the attribute closure of AB under F’ = {AB D, A E, and E C}. The closure is ABCDE, which includes CD, so we infer that C is extraneous.
[Source: Database System Concepts – Korth]






What is extraneous attributes?

Role of extraneous attributes in normalization process

How to find extraneous attributes in database normalization

Why do we need to find extraneous attributes in finding closures?

Closure of functional dependencies and extraneous attributes

Relationship between extraneous attributes and canonical cover


Thursday, August 28, 2014

Various uses of attribute closure


What are the uses of attribute closure A+ / Purposes of finding attribute closure / Attribute closure in DBMS


Several uses of attribute closure:

1. Used to check whether an attribute (or set of attributes) forms a key or not.
2. Used to find easily all the functional dependencies hold in a relation.
For example, to check whether a FD like A B holds in a relation, find the A+. If B is in A+, then the functional dependency A B is valid.
3. Used as an alternate way to find Closure of FDs (F+).
For every attribute or set of attributes on the left hand side of the arrow in a functional dependency, find the Closure. This process results in F+.





Tuesday, August 26, 2014

How to find key of a given table? - An alternate way




Closure of Attribute Set - Alternate Way / Closure of Attribute Set Algorithm / How do we find a key given a set of attributes? / How to find super key? / Attribute Closure in DBMS / Closure of Attributes Set Example





To find the Closure of attribute/attribute set A, we have to do the following;

          a) First of all find the set of all functional dependencies (F+) that are implied by a given set of functional dependencies (F).
            b) Then take all the FDs from F+ that has A on the left hand side of the arrow.
          C) Finally, find the union of right hand side of all those functional dependencies that have A on the left hand side. If the union includes all the attributes of the given relation R, then A is the key for the relation.

Example:
Assume a relation schema R = (A, B, C) with the set of functional dependencies F = {A B, B C}. Now, we can find the closure of attribute A as follows, according to this method;
Step 1: Find the F+.
F+ = { A B, B C, A C } [A C is derived using Transitivity rule]
Step 2: A B, and A C are the two functional dependencies that have common left hand side attribute A.
Step 3: The union of right hand sides ends with A BC. Hence, A is the one of the keys for the relation R.

Advantages:


  • Simple.

Drawbacks:


  • The number of functional dependencies in F+ can be as many as 2n+1 where n is the number of attributes. It costs too much of time.


Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents