Re: MV Keys
Date: 6 Mar 2006 09:20:05 -0800
Message-ID: <1141665605.618414.277950_at_j52g2000cwj.googlegroups.com>
vc wrote:
> Jon Heggland wrote:
> > In article <1141393487.167645.153600_at_v46g2000cwv.googlegroups.com>,
> > boston103_at_hotmail.com says...
> > >
> > > Saying that the date is not scalar is akin to claiming that 254 is not
> > > a scalar because it consists of units, tens and hundreds ;)
> >
> > You say that as if it were a silly thing to claim. :)
>
> Is it not ? Forgetting about time zones, the date is just a natural
> number in a peculiar notation (or if one wants to be picky, a subtype
> thereof). Is the natural number a compound type ?
>
> > --
> > Jon
This is partially true. It depends of the meaning of the date and on the design of the database.
1.
If you think that the date means "number-of-days" between the year
of Christ's birth and this date, then the date is
"number-of-days" and you are right - the date is scalar. (same
thing with a date_time_stamp and "number of secunds"). In this case
you can design for example an entity E1 (A,B,C,date) and use the
attribute date for Key. However the attributes A,B,C can have different
"number-of-days"; their "datefrom/to/during/etc" can be
different; their since when "time-status" has different meaning
regarding "numbers-of-days". So we should be careful with date as
Key. I wrote about this in more details on my web site:
www.dbdesign10.com , 2.4. under 2. and example 2.5
2.
I can choose that year, month, day, hour etc has meaning which
doesn't have any relation to "number-of-days" and to the first
day. It depends on application. In this case I can design an entity E2
(A, B, C, Year, Month, Day, Hour, Min, Sec). Here "numbers-of-days"
or date_time_stamp can't be Key because they aren't the attributes
of the entity. Even more, here we don't have an attribute date. Now we
can derive date as a compound data (for some programming).
Vladimir Odrljin Received on Mon Mar 06 2006 - 18:20:05 CET