Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: null as part of key?

Re: null as part of key?

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Tue, 23 Oct 2001 10:03:56 +0100
Message-ID: <3bd532bc$0$232$ed9e5944@reading.news.pipex.net>


Comments below
"ed zappulla" <zappullae_at_rcn.com> wrote in message news:9r1eih$aiq$1_at_bob.news.rcn.net...
> I see. What about this case
>
> country
> state
> city
> some other cols
>
> pk = country, state, city

Doesn't look like a good primary key candidate to me. Does country,state,city really uniquely identify the record? Postal code would be a more likely meaningful key, or has been suggested use a sequence as a meaningless key.
>
> Some contries don't have states; therefore it would be null for those
> countries.
>
> does this make sense?

No. Null means value unknown NOT no value. Therefore if you are going to account for the situation you describe you should use some other alternative "none" or "N/A" spring to mind. You do know that there is no value for state in this record.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
Received on Tue Oct 23 2001 - 04:03:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US