Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: null as part of key?
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 UKReceived on Tue Oct 23 2001 - 04:03:56 CDT