Partial Dependency(Databases)

前端 未结 9 1209
时光说笑
时光说笑 2020-11-29 01:19

I need closure on this. I fabricated a definition that partial dependency is when fields are indirectly dependent on the primary key or partially dependent but are also dep

9条回答
  •  眼角桃花
    2020-11-29 01:47

    If there is a Relation R(ABC)

    -----------
    |A | B | C |
    -----------
    |a | 1 | x |
    |b | 1 | x |
    |c | 1 | x |
    |d | 2 | y |
    |e | 2 | y |
    |f | 3 | z |
    |g | 3 | z |
     ----------
    Given,
    F1: A --> B 
    F2: B --> C
    

    The Primary Key and Candidate Key is: A

    As the closure of A+ = {ABC} or R --- So only attribute A is sufficient to find Relation R.

    DEF-1: From Some Definitions (unknown source) - A partial dependency is a dependency when prime attribute (i.e., an attribute that is a part(or proper subset) of Candidate Key) determines non-prime attribute (i.e., an attribute that is not the part (or subset) of Candidate Key).

    Hence, A is a prime(P) attribute and B, C are non-prime(NP) attributes.

    So, from the above DEF-1,

    CONSIDERATION-1:: F1: A --> B (P determines NP) --- It must be Partial Dependency.

    CONSIDERATION-2:: F2: B --> C (NP determines NP) --- Transitive Dependency.

    What I understood from @philipxy answer (https://stackoverflow.com/a/25827210/6009502) is...

    CONSIDERATION-1:: F1: A --> B; Should be fully functional dependency because B is completely dependent on A and If we Remove A then there is no proper subset of (for complete clarification consider L.H.S. as X NOT BY SINGLE ATTRIBUTE) that could determine B.

    For Example: If I consider F1: X --> Y where X = {A} and Y = {B} then if we remove A from X; i.e., X - {A} = {}; and an empty set is not considered generally (or not at all) to define functional dependency. So, there is no proper subset of X that could hold the dependency F1: X --> Y; Hence, it is fully functional dependency.

    F1: A --> B If we remove A then there is no attribute that could hold functional dependency F1. Hence, F1 is fully functional dependency not partial dependency.

    If F1 were, F1: AC --> B;
    and F2 were, F2: C --> B; 
    then on the removal of A;
    C --> B that means B is still dependent on C; 
    we can say F1 is partial dependecy.
    

    So, @philipxy answer contradicts DEF-1 and CONSIDERATION-1 that is true and crystal clear.

    Hence, F1: A --> B is Fully Functional Dependency not partial dependency.

    I have considered X to show left hand side of functional dependency because single attribute couldn't have a proper subset of attributes. Here, I am considering X as a set of attributes and in current scenario X is {A}

    -- For the source of DEF-1, please search on google you may be able to hit similar definitions. (Consider that DEF-1 is incorrect or do not work in the above-mentioned example).

提交回复
热议问题