Re: boolean datatype ... wtf?

From: paul c <toledobythesea_at_oohay.ac>
Date: Wed, 29 Sep 2010 17:12:21 GMT
Message-ID: <VrKoo.1074$u9.308_at_edtnps82>


On 29/09/2010 9:36 AM, Paul Mansour wrote:

> On Sep 29, 11:38 am, paul c<toledobythe..._at_oohay.ac>  wrote:

>> On 29/09/2010 7:45 AM, Bob Badour wrote:
>>
>>
>>
>>
>>
>>> Paul Mansour wrote:
>>
>>>> On Sep 29, 9:46 am, paul c<toledobythe..._at_oohay.ac> wrote:
>>
>> ...
>>>>> Aren't A=B and A>B relations?
>>
>>>> I was under the impression that they are not, even if A and B are
>>>> relations. But I may have misintepreted C.J. Date on this.
>>
>>>> In "Database in Depth" he writes:
>>
>>>> "In Chapter 2, I mentioned the fact that the equality comparison
>>>> operator "=" applies to every type. In partitular, therefore it
>>>> applies to relation types.... Now I must immediatly explain that these
>>>> opeartors are not relational operators as such -- that is they are not
>>>> part of the relational algebra-- because their result is a truth
>>>> value, not a relation."
>>
>>> An algebra is a set of values and a set of operations closed on that set
>>> of values.
>>
>>> Date is saying that comparisons are not part of the relational algebra
>>> in the same way that division is not part of the integer algebra because
>>> dividing any two arbitrary integers is not necessarily closed on integers.
>>
>>> Consider an expression of the form:
>>
>>> R = f(A,B)
>>
>>> where both A and B are relations and f is some binary operation. If f is
>>> natural join, then R is a relation. If f is a comparison, then R is not
>>> a relation; it is a boolean.
>>> ...
>>
>> Thanks for the precise example. It seems to me that Date means your
>> last sentence as his starting point. Nothing 'wrong' with that, but my
>> question might be 'why does that have to be so'? Isn't it just as valid
>> to say that R can be one of DEE or DUM for certain f?- Hide quoted text -
>>
>> - Show quoted text -
>
> Regarding "why does that have to be so?"...
>
> The quote from Date above follows and refers to a discussion of the
> equality operator for types. It appears to suggest that there should
> be some consistancy in the result of the operator.
>
> Are you suggesting that  5=6 returns DEE as well, or that 5=6 returns
> a boolean scalar while R1=R2  (where Rx is a relation) returns DEE or
> DUM?  It seems to me that while it is very important to recognize the
> value of the concepts of DEE and DUM, that attempting to eliminate a
> boolean type and replace it with DEE and DUM is only going to add
> complexity.
>
>

I think all I'm suggesting is that a relation called 'integer_five_equals_six' with value (omitting types):

x y
5 6

is considered true if it appears in a db. We could materialize it to see what integers make it true but if we don't care which ones do that, we can avoid the materialization and just project it on the empty set of attributes. I'm thinking this comes down to saying that strictly speaking a minimal language doesn't even need to embed names such as 'dee' and 'dum', it could be inherent in the syntax, eg., I think TTM allows what 'dee' stands for to be written as RELATION {} {} or suchlike.

No argument if you say that is too ponderous or more complex than users want but I think that is an answer to a different question than "is it logical?". Received on Wed Sep 29 2010 - 19:12:21 CEST

Original text of this message