Re: Identifying candidate keys and primary keys

From: Brian Selzer <brian_at_selzer-software.com>
Date: Sun, 13 Apr 2008 21:50:31 -0400
Message-ID: <ILyMj.571$26.132_at_newssvr23.news.prodigy.net>


<noagbodjivictor_at_gmail.com> wrote in message news:7b355c27-a3c3-488b-994e-c2559a08a8b4_at_f63g2000hsf.googlegroups.com...
> On Apr 13, 7:05 am, "Brian Selzer" <br..._at_selzer-software.com> wrote:
>> <noagbodjivic..._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.
>>
>> Can a patient be in more than one ward (at the same time)?
>>
>> > This means that I have found only one candidate key, and this is also
>> > the primary key I have found (a composite).
>>
>> > Since the question was "identify all the candidate keys" I thought
>> > maybe I dont really understand the concepts...
>>
>> http://en.wikipedia.org/wiki/Candidate_key
>>
>> > thanks for any help.
>
> Brian, I don't really know...
>
> I have been looking at how hospitals work here in US. From what I have
> learned online, I don't think it's possible to have a patient in
> multiple ward at the same time (and I can't confirm).
>
> Also from what I have learned it seems like the ward names are unique
> in hospital. It probably means that a ward number assigned to a name
> is also unique. So that when we take a name, we have the number. But I
> can't confirm that either, I have found all this by searching
> online...

Unless you can identify the functional dependencies, you won't be able to identify the candidate keys. If you don't know enough about the subject matter (or weren't provided with that information as part of the assignment), then you might as well join Bluto. Received on Mon Apr 14 2008 - 03:50:31 CEST

Original text of this message