Re: Nearest Common Ancestor Report (XDb1's $1000 Challenge)
Date: Thu, 20 May 2004 23:38:58 +0200
Message-ID: <s29qa0t87af3camvvc5bh47l7a03397tqs_at_4ax.com>
On 19 May 2004 20:03:18 -0700, Neo wrote:
(snip class/domain stuff)
>> a datatype as a superset of many domains.
>> The domain for all integers is the same as the datatype
>> integer. The domain for attribute "age (in years)" of the class "employee"
>> is a subset of the integer domain.
>
>Suppose, car is the class of car1. Car1 has the attribute color. The
>attribute's value can be from the domain containing red and green.
>Would data type be red, green and blue (assume these are all the
>colors)?
No. The data type would be character. And the domain would be {red, green} (I have no idea why blue should be added to the domain if cars can only be red or green).
> Or does data type include more things including '*&#xyzPN'?
Yes. As I said: the data type would be character. The restriction to either 'red' or 'green' is in the domain.
>Would a color domain delcared as char(5) have a different data type
>than when declared as char(6)?
I consider them both to be the character domain, but the RDBMS will obviously reserve one extra byte for storing the char(6) as opposed to the char(5).
> Is there a difference between "type"
>and "data type"?
Without context, "type" can refer to anything: data type, entity type, relationship type, car type - heck, it could even be a verb!
The context dictates what type is meant if the word "type" is used on it's own. If the context indicates that "type" refers to "data type", then there is obviously no difference.
> It seems to me that "data type" has a dual meaning,
>one on which is related to hardware storage specifics?
I'd use a slightly different formulation: data types are used to close the gap between a domain and the representation of values by computers.
> In reality,
>colors have nothing to do with char, integer or float. But when stored
>in most dbs they could have those data types. Where are the theorists
>:)
Colors can't be stored in databases at all. The closest you'd get was if you poured the contents of a bucket of red paint through the floppy disk slotm of your computer - but then you'd be storing paint in your computer, not a color.
The only thing that a database (or any other computer program) can store is a *reference* to a color. One of the last steps of designing a model for your data is deciding how this reference will look. Colors might be referenced by a name (but do not forget to specify the language to use, otherwise you'll have 'rot', 'vert' and 'blauw' in your table before you can say RGB), but RGB values, industry-standard color numbers, an inhouse color number or a pointer (invisible to the user, but nevertheless stored in the computer) might be used just as well. Distances might also be referenced by a descriptive name or a pointer, but they are commonly referenced by a number; it remains important that everybody agrees on what that number means: miles? kilometers? Space shuttles have blown up over trivialities like these!
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)Received on Thu May 20 2004 - 23:38:58 CEST
