Re: Primary Key and Unique Key
From: argusy (argusy_at_slmember.on.net)
Date: 08/23/04
- Previous message: fniles: "Re: Primary Key and Unique Key"
- In reply to: fniles: "Re: Primary Key and Unique Key"
- Next in thread: Lishi Liu [MSFT]: "RE: Primary Key and Unique Key"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 23 Aug 2004 21:43:02 +0930
yes.
You might get garbage, but you can relate any key to any field in any other table.
i.e.
T1
ID (autonumber) primary, unique
ClassID (number) not unique
StudentID (number) unique
surname (text) no key
Firstname (text) no key
T2
ID (number) primary, unique
subject (text) not unique
I could relate T1 studentID with T2 classID, but that would be stupid
I could relate T1 ID with T2 studentID, (again stupid)
I could relate T1 classID with T2 ID, and this WOULD be useful
none (except one is declared as "primary")
The primary key is the one you've declared as primary.
(It may or may not be unique, but always take the view that any primary key you declare IS
unique)
Argusy
fniles wrote:
> Thanks. I am still confused.
> So, does it mean that both primary key and unique keys
> can also be related to other tables ?
> So, what are the difference between the two keys ?
> What are the difference between primary key and the
> secondary keys ?
> Thanks.
>
>
>>-----Original Message-----
>>"Fie Fie Niles" <fniles@wincitesystems.com> wrote in
>
> message
>
>>news:%23tvz2UwhEHA.704@TK2MSFTNGP12.phx.gbl
>>
>>>Is it correct that primary key can be related to other
>>
> tables, but
>
>>>unique keys don't ?
>>
>>No
>>
>>--
>>Reply to the group so all can participate
>>VB.Net... just say "No"
>>
>>.
>>
>
- Previous message: fniles: "Re: Primary Key and Unique Key"
- In reply to: fniles: "Re: Primary Key and Unique Key"
- Next in thread: Lishi Liu [MSFT]: "RE: Primary Key and Unique Key"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|