Re: Identifying candidate keys and primary keys
Date: Sun, 13 Apr 2008 11:51:23 GMT
Message-ID: <%smMj.3566$mG1.1917_at_trndny08>
<noagbodjivictor_at_gmail.com> wrote in message
news:fc37fe0e-476b-4a0b-8396-ab81c9a5f4a1_at_u69g2000hse.googlegroups.com...
> Hello guys, this one is for one of my assignments. I want explanations
> and hints only.
>
> I'm still confused with the concepts of candidate keys and primary
> key. We have a patient medication form from an hospital with these:
>
> Heading: Patient number, Full name, Bed number, Ward number, Ward
> name.
> Then a table with this columns: drug number, name, description,
> dosage, method of admin, units per day, start date, finish date.
>
> I have to find all the candidate keys and primary keys. I think
> candidate keys are the minimal superkeys.
>
> I have found {Patient number, Ward number, Ward name}. I have excluded
> {Patient number, Ward number, Ward name, Full name} and {Patient
> number, Ward number, Ward name, Full name, Bed number} which are also
> superkeys but contain more attributes.
>
> This means that I have found only one candidate key, and this is also
> the primary key I have found (a composite).
>
You haven't given us enough information to check your solution to see if it's correct. Brian asked one of the questions that needs an answer before knowing whether your candidate key is a superkey or not.
If there is only one candidate key, then that key is the primary key. You got that part right.
> Since the question was "identify all the candidate keys" I thought
> maybe I dont really understand the concepts...
>
I agree that an example with only one candidate key is suspicious... just based on the way people make up quiz questions.
> thanks for any help.
Received on Sun Apr 13 2008 - 13:51:23 CEST