Re: Examples of SQL anomalies?
From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Thu, 03 Jul 2008 12:32:54 -0300
Message-ID: <486cf12b$0$4040$9a566e8b_at_news.aliant.net>
>> On Jul 3, 7:19 am, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
>>
>>> David Cressey wrote:
>>>
>>>
>>>>> MIN, MAX and AVG are meaningless when applied to an empty bag, but
>>>>> it seems
>>>
>>>
>>> Bullshit! The identity element for min is the largest representable
>>> value. The identity element for max is the smallest representable
>>> element.
>>
>>
>>
>> I don't entirely agree.
>>
>> Certainly for mathematical integers, there is no largest representable
>> element. In more practical terms, one can imagine an "arbitrary"
>> precision integer, which starts with a 32 bit length value followed
>> by that many 32 bit quantities of bits. Although one *could*,
>> on attempting to evaluation MIN of an empty set/bag, return
>> the smallest representable number,
>> the 16 gigabytes of RAM that are necessary to do so is a good
>> idea.
>>
>> For fixed-size integer values, there are no implementation
>> difficulties.
>> However, I'm not sure that semantically, this is entirely what we
>> want, even though there is the very strong argument that the
>> smallest int is the identity for the operation.
Date: Thu, 03 Jul 2008 12:32:54 -0300
Message-ID: <486cf12b$0$4040$9a566e8b_at_news.aliant.net>
Bob Badour wrote:
> Marshall wrote: >
>> On Jul 3, 7:19 am, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
>>
>>> David Cressey wrote:
>>>
>>>
>>>>> MIN, MAX and AVG are meaningless when applied to an empty bag, but
>>>>> it seems
>>>
>>>
>>> Bullshit! The identity element for min is the largest representable
>>> value. The identity element for max is the smallest representable
>>> element.
>>
>>
>>
>> I don't entirely agree.
>>
>> Certainly for mathematical integers, there is no largest representable
>> element. In more practical terms, one can imagine an "arbitrary"
>> precision integer, which starts with a 32 bit length value followed
>> by that many 32 bit quantities of bits. Although one *could*,
>> on attempting to evaluation MIN of an empty set/bag, return
>> the smallest representable number,
> > > That would be largest not smallest. > > > it's not clear that allocating >
>> the 16 gigabytes of RAM that are necessary to do so is a good
>> idea.
>>
>> For fixed-size integer values, there are no implementation
>> difficulties.
>> However, I'm not sure that semantically, this is entirely what we
>> want, even though there is the very strong argument that the
>> smallest int is the identity for the operation.
> > > Largest int is the identity for MIN.
Correction: the data type doesn't have to be int. It could be any data type. Received on Thu Jul 03 2008 - 17:32:54 CEST