Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Functional Dependency

Status
Not open for further replies.

Maypen

Technical User
Feb 6, 2003
32
GB
Hi Guys,

I am just learning about designing relational databases. I am on Functional Dependency. I understand some of it but when i come to certain scenarios i am lost. Can anyone explain it in layman terms or suggest a good site / tutorial / book.
Cheers!
 
From...

Given a relation R (in a relational database), attribute Y of R is functionally dependent on attribute X of R and X of R functionally determines Y of R (in symbols R.X -> R.Y) if and only if each X in R has associated with it precisely one Y in R (at any one time).


In otherwords, an attribute of your dependency is considered functionally dependent iff there is another attribute in that relation which determines that value of Y... X must be associated to one and only one Y.

Ok, so lemme try layman's terms...

If you say everyone with an apartment number must live in an apartment, everyone without an apartment number lives in a house.

the Relation is something like, Does this person live in an apartment.

Our individual's relation is APT

If APT(X) == NULL THEN Y is HOUSE
If APT(X) == NUMERIC THEN Y is Apartment

Hope that made some sense, I haven't even thought of functional dependencies formally in about a year and half.

-Rob
 
Which is a long-winded way of saying that the value of X determines the value of Y. If you know what X is, you also know what Y is.

If relation R1 contains attributes X and Y, and Y is functionally dependent on X, you can remove the functional dependency from relation R1 by

- creating relation R2 with columns X and Y that describes the dependency (list the X-Y pairs)

- removing the Y column from R1

- looking up Y in R2
 
Yeah, and my example was a bad one, because part of the point is, X tells you what Y is, but Y cannot necessarily tell you what X is.

A one way hash is a better example of a functional dependency.

-Rob
 
Thanks for your replies guys.I understand a little bit more.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top