Re: functional dependencies

From: Larry Coon <larry_at_assist.org>
Date: Wed, 11 Jun 2003 09:51:17 -0700
Message-ID: <3EE75E05.3D24_at_assist.org>


Rohan Hathiwala wrote:
>
> Dear Adre and Larry
> I would like to thank you for the feedback you have given me
> and I am sorry I did not realize that the example I gave was
> not in 3NF at that time. Now coming to the normalization that
> Andre did to my example and agree that it is correct. Now we have
> 2 FD's
> project_name -> prof_name
> prof_name -> course_taught
>
> Now let me quote the definition of an FD as given in Korth's book
> "In a relation R if we have 2 attributes A and B and suppose an
> FD exists i.e A -> B then for any two tuples t1 and t2 in
> R if t1[A] = t2[A] the we must have t1[B] = t2[B]"

Yes, and Date has a similar definition:

  Let R be a relation avariable, and let X and Y be   arbitrary subsets of the set of attributes of R.   Then we say that Y is functionally dependent on X,   in symbols X -> Y (read "X functionally determines   Y," or simply "X arrow Y") -- if and only if, in   every possible legal value of R, each X-value has   associated with it precisely one Y-value.

So both are saying that for the set of all possible valid tuples in R, if any two tuples that have the same value for X also have the same value for Y, then X -> Y.

> Now if we make A as the primary key then we would never ever
> have any 2 tuples in t1 and t2 such that t1[A] = t2[A] because
> it would violate the primary key constraint so does it make
> sense in this case say that A funcationally determines B since
> for and FD like A -> B to exist we should also have a situation
> where we can have t1[A] = t2[A] as per definition of FD and I
> repeat this would never happen if we make A a primary key.

Yes, the primary key, by definition functionally determines all non-key attributes in the tuple. The same is true for any candidate key, not just the primary key.

> Now let me rephrase my original question (in quotes).
> "Give me an example of a relation where there is an FD where the
> attributes invloved are not key attributes and also see to that
> it does not violate any of the normal forms."

You just jumped from the more precise "primary key" to the more vague "key attributes," so I'm afraid it's still not clear exactly what you're asking for. If by "key attributes" you're still referring specifically to the primary key, then this is easy.

> I would also like to post another question at this point.
> Can any one give me an example of a relation where we have a
> trivial FD?
> A trivial FD is of the form
> A -> B where B is a subset of A.

To quote Date again, "Trivial dependencies are not very interesting in practice." Is this a homework question?

Larry Coon
University of California
larry_at_assist.org
and lmcoon_at_home.com Received on Wed Jun 11 2003 - 18:51:17 CEST

Original text of this message