Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Partial Dependency (Databases)

I fabricated a definition that a partial dependency is when fields are indirectly dependent on the primary key or partially dependent but are also dependent on other keys that depend on the primary such that if the field which another field depends on is deleted then that field will still exist due to its dependence on the primary key. I am not sure if it is correct. I have researched and every definition sounds misleading. Is my definition correct and if not what is?

like image 593
rert588 Avatar asked Sep 09 '14 14:09

rert588


People also ask

What is partial dependency example?

Partial Functional Dependency : A functional dependency X->Y is a partial dependency if Y is functionally dependent on X and Y can be determined by any proper subset of X. For example, we have a relationship AC->B, A->D, and D->B. Here A is alone capable of determining B, which means B is partially dependent on AC.

Is partial dependency allowed in 2NF?

No partial dependency is allowed in 2NF If x y holds in any relation, then there should not be any proper subset z of x for which z a also holds; where x is prime attribute(s) and y, a is non prime attribute(s).

What is the difference between partial and transitive dependency?

What is a transitive and partial dependency? Transitive dependency occurs when some non-key attribute determines some other attribute. On the other hand, partial dependency occurs when one primary key determines some other attribute/attributes.

What is a dependency database?

A dependency is a constraint that applies to or defines the relationship between attributes. It occurs in a database when information stored in the same database table uniquely determines other information stored in the same table.


1 Answers

A FD (functional dependency) that holds in a relation is partial when removing one of the determining attributes gives a FD that holds in the relation. A FD that isn't partial is full.

Eg: Suppose {A,B} → {C} but also {A} → {C}. Then {A,B} → {C} is partial; {C} is partially functionally dependent on {A,B}; {C} is functionally dependent on a part of {A,B} that is not all of it. The consequent partial FD is not {A} → {C}. Whether that is partial depends on (per the definition of partial FD) whether a subset of {A} determines {C}; whether {} → {C}.

Eg: Here's a relation value where that example condition holds. (A FD holds in a relation variable when it holds in every value that can arise.)

A  B  C 1  1  1 1  2  1 2  1  1 

The non-trivial FDs that hold: {A,B} determines {C}, {B,C}, {A,C} & {A,B,C}; {A}, {B} & {} also determine {C}. Of those: {A,B} → {C} is partial per {A} → {C}, {B} → {C} & {} → {C}; {A} → {C} & {B} → {C} are partial per {} → {C}; the others are full.

A functional dependency X → Y is a full functional dependency if removal of any attribute A from X means that the dependency does not hold any more; that is, for any attribute A ε X, (X – {A}) does not functionally determine Y. A functional dependency X → Y is a partial dependency if some attribute A ε X can be removed from X and the dependency still holds; that is, for some A ε X, (X – {A}) → Y.

-- Fundamentals OF Database Systems 6th Edition, Ramez Elmasri & Navathe

Notice that whether a FD is full vs partial doesn't depend on CKs (candidate keys), let alone one CK that you might be calling the PK (primary key).

(A definition of 2NF is that every non-CK attribute is fully functionally determined by every CK. Observe that the only CK is {A,B} & the only non-CK attribute C is partially dependent on it so this value is not in 2NF & indeed it is the lossless join of components/projections onto {A,B} & {A,C}, onto {A,B} & {B,C} & onto {A,B} & {C}.)

(Beware that that textbook's definition of "transitive FD" does not define the same sort of thing as the standard definition of "transitive FD".)

like image 125
philipxy Avatar answered Oct 30 '22 19:10

philipxy