Re: Help needed for Alternate Kye

From: Thomas Muller <ttm_at_online.no>
Date: Fri, 20 Oct 2000 17:30:58 +0200
Message-ID: <YDZH5.11056$W31.163034_at_news1.online.no>


<sangs5_at_my-deja.com> wrote in message news:8sogl0$a1f$1_at_nnrp1.deja.com...
| Hi..

|

| I am in the process of learning Data modeling and Data Desogining. I
| would like to know how to identify an alternate key. To me any candiate
| key which is not selected to be a primary key is an alternate key.

Any attribute or combination of such which uniquely identifies a tuple in a relation, is called a Candidate Key. You designate one of them as the Primary Key. Note that a Candidate Key is always a minimal superkey; that is, you can't remove any attributes from it without losing the uniqueness constraint.

| I
| have a sample table called as Order. It has Order No, Cust no, Order
| Date, Order Cost. Here Order No is the primary key. Customer No is the
| foreign key. Should I consider Order Date and Order Cost as alternate
| keys?

You have to ask yourself; will the combination of order date and order cost uniquely identify a row? Probably not. If this is the case, the database can't store sales of goods with the same cost on the same date. This does not match with the portion of the real world you intend to model.

--

Thomas
Received on Fri Oct 20 2000 - 17:30:58 CEST

Original text of this message