Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.multikabel.nl!83.128.0.11.MISMATCH!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!teleglobe.net!62.81.31.29.MISMATCH!cyclone.auna.com!news-feeder.eresmas.com!news-reader.eresmas.com!not-for-mail
From: Alfredo Novoa <alfredo_novoa@hotmail.com>
Newsgroups: comp.databases.theory
Subject: Re: Translating constraints to RM Terms
Message-ID: <mlb8a1ps7in8stb0v0vnb1uvdop3ssia2n@4ax.com>
References: <ianbn2-dj5.ln1@pluto.downsfam.net> <1118042868.581634.304340@g47g2000cwa.googlegroups.com> <42a4285d$0$8719$ed2619ec@ptn-nntp-reader02.plus.net>
X-Newsreader: Forte Free Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 45
Date: Mon, 06 Jun 2005 13:09:18 +0200
NNTP-Posting-Host: 217.125.117.100
X-Complaints-To: abuse@eresmas.com
X-Trace: news-reader.eresmas.com 1118056733 217.125.117.100 (Mon, 06 Jun 2005 13:18:53 MET DST)
NNTP-Posting-Date: Mon, 06 Jun 2005 13:18:53 MET DST
Organization: eresMas
Xref: dp-news.maxwell.syr.edu comp.databases.theory:31235

On Mon, 06 Jun 2005 11:41:32 +0100, Paul <paul@test.com> wrote:

>Here's an example to think about: I create a domain/type called "Number"
>which contains real numbers (maybe chopped off at some min/max values
>and some level of decimal places or significant figures). I make a
>column with this as the type. Then I add a column constraint like
>"round(col) = col" i.e. the value must be an integer.
>
>Is this functionally identical to creating an "integer" type and using that?

No, you would not have integer division, for instance.

>To go further, imagine a universal type that was a union of the set of
>every possible type you could want. You set every column to this type
>and then have column constraints to restrict each column to the values
>you want.

Then you would not have any operation other than equality. You would
have to "cast" the values all the time.

In Tutorial D there is a type that is the set of all scalar values:
Alpha

We can do things like this:

var a relation { a Alpha };

a := relation { tuple { a 1 }, tuple { a 'shoe' } };

Although this does not work with Rel AFAIK.

>Maybe this would link in with the thread on NULLs in that your universal
>type would only need a single universal NULL?

Nulls are not values, they are an ad hoc cheat.

>Note: I'm not seriously advocating this, just arguing a logical point to
>see if it reaches an absurdity.

Good attitude.


Regards


