Re: ID field as logical address

From: Brian Selzer <brian_at_selzer-software.com>
Date: Mon, 1 Jun 2009 23:14:19 -0400
Message-ID: <fO0Vl.18161$%54.5911_at_nlpi070.nbdc.sbc.com>


"Bernard Peek" <bap_at_shrdlu.com> wrote in message news:LDw5y3laeCJKFw6C_at_shrdlu.com...
> In message <MTTUl.27897$c45.17152_at_nlpi065.nbdc.sbc.com>, Brian Selzer
> <brian_at_selzer-software.com> writes

>>
>>"Bernard Peek" <bap_at_shrdlu.com> wrote in message
>>news:2hlWqCcL++IKFw36_at_shrdlu.com...
>>> In message <ImwUl.30133$PH1.14509_at_edtnps82>, paul c
>>> <toledobythesea_at_oohay.ac> writes
>>>>Walter Mitty wrote:
>>>>> "Brian Selzer" <brian_at_selzer-software.com> wrote in message
>>>>...
>>>>>> {{L:Smith,  F:Mary, Stat:Single},
>>>>>> {L:Jones, F:Mary, Stat:Married}}
>>>>>>
>>>>>> and is then assigned the value,
>>>>>>
>>>>>> {{L:Smith, F:Mary, Stat:Divorced},
>>>>>> {L:Jones, F:Mary, Stat:Married}}
>>>>>> ...
>>>>...
>>>>>> Note that the introduction of an autogenerated ID eliminates all
>>>>>> confusion:
>>>>>> ...
>>>>
>>>>"autogenerated ID eliminates all confusion", what a laugh, almost sounds
>>>>like a sleeping pill slogan.
>>>
>>> I think I'd say that an autogenerated ID hides the problem, or at least
>>> moves it around. Instead of asserting that the key always refers to an
>>> instance within the universe of discourse, you substitute an autonumber
>>> field and make the same assertion.
>>
>>Not so: addition is not the same as substitution.
>

> You misunderstand me. An ID field is added to the table but is substituted
> in the assertion.
>
>>
>>>
>>> In an entity the key refers unambiguously to an instance within the
>>> universe. When you build a database table that is an aspiration.
>>>
>>
>>Consider an ordered set, such as a deck of cards.  When implemented in a
>>relation schema, {Position, Card},  there are two candidate keys,
>>{Position}, and {Card}.  Now suppose that the deck is shuffled, and a
>>database update issued to reflect the new state of the deck.  The card at
>>the bottom of the deck before shuffling may not be the card at the bottom 
>>of
>>the deck after shuffling.  So despite the fact that Position is a 
>>candidate
>>key of the representative relation schema, instances of it do not
>>permanently identify things in the Universe.
>

> Within a single deck of cards at any point either {Position} or {Card} are
> keys. Within that universe of discourse either would be valid. But if you
> open this out to include the result of shuffling the deck then you also
> need to consider {Time}. Having done that you find that a compound key of
> {Time}{Position} or {Time}{Card} permanently identifies a thing in the
> universe.
>

That's not what the definition of a candidate key requires. The uniqueness property applies to /each/ possible relation, not to /every/ possible relation.

> You could take this a step further and expand the universe of discourse to
> include every state of every deck at every time. In which case you need to
> stipulate which deck of cards you are referring to as well as the time
> that you take your readings. I could make this arbitrarily complex by
> insisting that the model also covers Tarot cards and decks which are in
> the state of being shuffled.

>

> In many cases a database may not store all of the information required to
> for a key, and this is the norm when databases hold data about people.
> Nobody has yet come up with a practical key which uniquely identifies
> people. I think the closest that anyone has come is my suggestion in this
> newsgroup; Latitude, Longitude, Altitude and Time of birth.
>
>
>

> --
> Bernard Peek
Received on Tue Jun 02 2009 - 05:14:19 CEST

Original text of this message