Monday, 7 December 2020

DBMS Inference Rules

 

Inference rules in DBMS:

 

  1. Reflexivity rule: If 𝛂 is a set of attributes and π›ƒβŠ†π›‚, then 𝛂→ 𝛃 holds. This rule states that a set of attributes always determines itself or any of its subsets. The functional dependency 𝛂→ 𝛃 proven by the reflexivity rule is called a trivial functional dependency.
  2. Augmentation rule: If 𝛂→ 𝛃 holds and 𝝲 is a set of attributes then 𝝲𝛂→ 𝝲𝛃 holds. This rule says that adding the same set of attributes to both the left and right hand sides of a dependency results in another valid dependency.
  3. Transitivity rule: If 𝛂→ 𝛃 holds and 𝛃→ 𝝲 then 𝛂→ 𝝲 holds. This rule states that functional dependencies are transitive.
  4. Union rule: If 𝛂→ 𝛃 holds and 𝛂→ 𝝲 holds then 𝛂→ 𝛃𝝲 holds. This rule allows us to combine a set of functional dependency {X β†’ A1, X β†’ A2… X β†’ An }  into a single functional dependency X β†’ {A1, A2, …, An}.
  5. Pseudo transitivity rule: If 𝛂→ 𝛃 and 𝝲𝛃→𝝳 holds, then 𝛂𝛃→𝝳 holds.
  6. Decomposition rule: If 𝛂→ 𝛃𝝲 holds then 𝛂→ 𝛃 holds and 𝛂→ 𝝲 holds.

 

Functional dependency is a constraint between two sets of attributes A and B belonging to some relation R, such that for any tuples t1 and t2, if t1[A]=t2[A],then we must also have t1[B]=t2[B] i.e. for a given value of A, there must be only one value of B.

 

The functional dependency is denoted as A β†’ B i.e.  B is functionally dependent on A.

 

For ex:

 

Let       A= ItemCd

            B= { IName, Op_stock, Cur_stock, Rate }

 

For a given value of ItemCd, there is only one value of all the attributes in B or even a single attribute of B.

So we can say that

ItemCd→ { IName, Op_stock, Cur_stock, Rate }

 

and even

 

ItemCd→ IName or

ItemCd→ Op_stock and so on.

No comments:

Post a Comment