Re: The horse race

From: Mark Johnson <102334.12_at_compuserve.com>
Date: Tue, 21 Feb 2006 13:54:01 -0800
Message-ID: <an2nv15ikb7ot33vatovs1bl6i1rnh5hla_at_4ax.com>


Daniel Dittmar <daniel.dittmar_at_sap.corp> wrote:

>Mark Johnson wrote:
>> No that's a relation. In describing a race, the attributes might
>> include, gate. The gates are ordered.

>> But as I understand it, relations are not supposed to be sorted. So I
>> wondered that if a relation includes a horse's ranking, as a 'thing'
>> intrinsic, that one is trying to say that relations can be sorted?

>In a database that is not set oriented, you could simply add horses to a
>race, the gate number would be implicit through the insertion order.

SQL is inherently 'set based'. The database by its use of tables is 'set based'. These were based on the proposals of Codd, years ago. Simply inserting another record, another entity (some here prefer to call the entire row, a tuple), says nothing about the sort. But to add a sort is to create a sorted relation.

By the way, the order in which the horses break is important to gamblers. It conceivably would be weighted by other factors.

>In a set oriented model, any sort order must be explicitly defined
>through additional attributes, in this case the gate number. The
>database itself does not know that this attribute has to do anything
>with ordering (1). To get the values in the order defined through that
>attribute, you have to add an ORDER BY clause, which is a feature of the
>cursor, not of an relation.

So while the gate is a fundamental attribute of the entity, its presence does not contribute to any sort because it is defined away into a domain of cursors, and not relations? Received on Tue Feb 21 2006 - 22:54:01 CET

Original text of this message