Re: normalization

From: Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl>
Date: 26 Nov 2000 22:57:28 GMT
Message-ID: <8vs4go$926$1_at_news.tue.nl>


shawn wrote:
> hi all,
>
> i am doing an exercise on normalization and i was stuck on ..
>
> In UNF,
> primary key : student_no
>
> In 1NF,
> primary key : lease_no <- This attribute can uniquely identify a row without
> the attribute student_no. Is it possible to have only one key attribute for
> the primary key in 1NF?

Yes. The 1NF says absolutely nothing about the number of attributes in your candidate keys.

> can i remove the student_no which is a primary key
> in UNF ??

If you mean by "removing" that you do not indicate it as a candidate key, then yes you can do that. Look at the following small example:

   ( A B ( C D ) )

    a1 b1 c1 d1

           c2 d1
    a2 b2 c3 d2

           c4 d3

You can see that {A} is a candidate key. Now, if we flatten the relation we get:

   ( A B C D )

    a1 b1 c1 d1
    a1 b1 c2 d1
    a2 b2 c3 d2
    a2 b2 c4 d3

As you can see, the only candidate key is now {C} and {A} is certainly not a candidate key and not even part of one.

> if so, there will be no partial dependency exists? is it possible ?

Yes, it is. If all your candidate keys consist of just one atribute then there can be no partial dependencies and you will be automatically in 2NF.

-- 
  Jan Hidders
Received on Sun Nov 26 2000 - 23:57:28 CET

Original text of this message