Understanding 3NF: plain English please

前端 未结 4 1134
花落未央
花落未央 2021-02-04 17:06

I am working through an example problem in which we are trying to identify which of the following relations is in Third Normal Form (3NF). Here are the relations we are given:

4条回答
  •  佛祖请我去吃肉
    2021-02-04 17:44

    Let me explain in simple words:

    For the given relation, R1(ABCD),the functional dependencies are:

    ACD -> B

    AC -> D

    D -> C

    AC -> B

    Condition to be in 3NF

    X->Y here X is a Super key when Y is non-prime attribute else it can be any attribute

    Prime attributes are the attributes which belongs to the super key

    Non-prime attributes are the attributes which do not belongs to the super key

    Let us come back to relation R1,

    AC+=ABCD

    AD+=ABCD

    ACD+=ABCD and

    D+=DC

    Thus,we get AD,AC,ACD as our Super keys

    And A,C,D are prime attributes and B is a non-prime attributes

    ACD->B

    This Functional dependency is in 3NF as ACD is a super key and B is prime attribute

    AC->D

    This Functional dependency is also in 3NF as AC is a super key and D is prime attribute

    D->C

    This Functional dependency is also in 3NF as D is a prime attribute and C is also prime attribute

    AC->B

    This Functional dependency is also in 3NF as AC is a super key and B is non-prime attribute

      Thus,the relation is not in 3NF only when non-prime attributes
      does not depend on super key
    

    Hope,this helps!

提交回复
热议问题