Re: functional dependencies

From: andrewst <member14183_at_dbforums.com>
Date: Tue, 10 Jun 2003 12:20:39 +0000
Message-ID: <2984440.1055247639_at_dbforums.com>


Originally posted by Rohan Hathiwala
> 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.
>
I don't think anyone (myself included) understands what your question actually is. You know what a functional dependency is. You presumably know that your Prof_activity table example is not properly normalised because of the FD of course_taught on a non-key column. You know that Prof_name is FD on the Project_name column, which is the primary key, so that is OK. So presumably you know that the normalised version of your example would be something like:

create table Project(

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

);
create table Professor(
        prof_name varchar(20) primary key,
        course_taught varchar(20) NOT NULL
);

..because all non-key columns are now FD on the key columns.

So what is your question?

--
Posted via http://dbforums.com
Received on Tue Jun 10 2003 - 14:20:39 CEST

Original text of this message