Re: Table design question

From: Bob Badour <bbadour_at_golden.net>
Date: Thu, 5 Feb 2004 17:46:47 -0500
Message-ID: <4tadnev8FcqeVb_d4p2dnA_at_golden.net>


"Bob Hairgrove" <wouldnt_you_like_at_to_know.com> wrote in message news:1nc520hotjrdtri2psoab8t0gd1rr6hi9q_at_4ax.com...
> On 23 Jan 2004 06:39:42 -0800, andrewst_at_onetel.net.uk (Tony) wrote:
>
> >There is nothing wrong with having a one-column, key-only table -
> >though I have known people who considered this to be illegal for some
> >reason. On one occasion I actually had to add an additional non-key
> >column (e.g. user_name for your example) just to appease them!
> >
> >The bottom line is: a user is an entity, and so there should be a
> >table in which a user is defined once only; neither user_history nor
> >log fulfill this function.
>
> The proper way to design this would be to create a domain of users.

Even with a user domain, one might still have a unary table.

> That is what the one-column table is actually doing (i.e. enforcing
> the domain RI).

No, it is not defining a domain; the data type of the single column defines the domain. The table does enforce RI for the actual current users from the domain.

For instance, suppose one has a domain User with a character string possible representation. The following three users might all be valid values of the domain: User('Hairgrove'), User('Badour'), User('Pegasus')

At some point in time, User('Hairgrove') and User('Badour') might be the only actual users, and the domain will do nothing to prohibit any table from referencing any mythical user like User('Pegasus'). A relation or table of the actual users will, however, allow one to enforce such referential integrity even if it is a unary table.

> (IMHO)
Not worth much. Received on Thu Feb 05 2004 - 23:46:47 CET

Original text of this message