Re: functional dependencies

From: Rohan Hathiwala <rp_hathiwala_at_yahoo.com>
Date: 9 Jun 2003 23:34:03 -0700
Message-ID: <3ec1cded.0306092234.2a258bad_at_posting.google.com>


Dear Larry Coon,

      I already know what a FD is my original question was something else, however coming to the person table example that you have given me, I am not satisfied by it. The reason being that when you include the date of birth attribute the age becomes a derived arttribute and it is considerd bad practice to include derived attributes in a relation refer to Database System Concepts. Now I will give you an example that I think would illustrate FD's well.
Consider a University where a Prof. is involved in several different projects and so he is able to take only one course per semester. Now for a pirticular sem if we make the following table

create table Prof_activity{

	project_name varchar(20) primary key,
	prof_name varchar(20) NOT NULL,
	course_taught varchar(20) NOT NULL

}

In the above example we automatically have an FD i.e. prof_name -> course_taught and the prof_name can repeate itself across various tuples in the relation since he can be associated with various projects. I donot know why anyone would want to make the above table but it serves as a good example to explain a functional dependency as in the above case the course_taught attribute depends soley on the prof's personal interest and cannot be derived from a mathematical function. I would like to have your feedback on this.
Regards,
Rohan.

Larry Coon <larry_at_assist.org> wrote in message news:<3EE4ADC3.6D2A_at_assist.org>...
> Rohan Hathiwala wrote:
>
> > I hope you all know what a functional dependency is. I would like to
> > know whether functional dependencies mainly apply to those
> > attributes in a relation whose values have a tendency to repeat
> > themselves across various tuples in that relation.
>
> An attribute is functionally dependent on another attribute
> if its value can be determined by that attribute. That is,
> if we know the value of some data, we can figure out the
> value of other data. As its name suggests, it comes from
> the mathematical definition of a function. If B = ?(A),
> then B is functionally dependent on A.
>
> One of the more common examples with databases is something
> like this:
>
> create table person (
> social_security_number numeric(9) not null,
> last_name varchar(20) not null,
> first_name varchar(20) not null,
> date_of_birth date not null,
> age int not null,
> prinary key (social_security_number)
> )
>
> Here age is functionally dependent on date_of_birth,
> because if we know the date_of_birth (and the current
> date) we can determine the age.
>
> The above is a simple case. Since functional
> dependencies are reflexive, augmentive, transitive,
> projective, additive and pseudotransitive, more
> complex (and less obvious) cases can be constructed.
>
> Any good database text should cover this in detail.
>
>
> Larry Coon
> University of California
> larry_at_assist.org
> and lmcoon_at_home.com
Received on Tue Jun 10 2003 - 08:34:03 CEST

Original text of this message