Re: Requirements for update languages?

From: Lauri Pietarinen <lauri.pietarinen_at_atbusiness.com>
Date: 12 Nov 2002 05:12:26 -0800
Message-ID: <e9d83568.0211120512.2b06ec2f_at_posting.google.com>


> Hands up who thinks bags are a good idea.

One interesting consequense of bags is that the cartesian product cannot be defined.

<quote from http://www.dbdebunk.com/cjddtdt_2.htm>

The first problem concerns Cartesian product. Part of the standard's explanation of the SQL FROM clause reads as follows:

 [The] result of the <from clause> is the ... Cartesian product of the tables identified by [the] <table reference>s [in that <from  clause>]. The ... Cartesian product, CP, is the multiset of all rows R such that R is the concatenation of a row from each of the

                         identified tables ... .  

  Note, therefore, that CP is not well-defined! -- the fact that the standard goes on to say that "The cardinality of CP is the product   of the cardinalities of the identified tables" notwithstanding. Consider the tables T1 and T2 shown below:

                         T1     T2  
                         +----+ +----+  

¦ C1 ¦ ¦ C2 ¦
+----¦ +----¦
¦ 0 ¦ ¦ 1 ¦
¦ 0 ¦ ¦ 2 ¦
+----+ +----+

 Either of the following fits the above definition for "the" Cartesian product CP of T1 and T2 (that is, either one could be "the"

                         multiset referred to):  

                         CP1         CP2 
                         +---------+ +---------+  

¦ C1 ¦ C2 ¦ ¦ C1 ¦ C2 ¦
+----+----¦ +----+----¦
¦ 0 ¦ 1 ¦ ¦ 0 ¦ 1 ¦
¦ 0 ¦ 1 ¦ ¦ 0 ¦ 2 ¦
¦ 0 ¦ 2 ¦ ¦ 0 ¦ 2 ¦
¦ 0 ¦ 2 ¦ ¦ 0 ¦ 2 ¦
+---------+ +---------+

   As an exercise, I suggest you try your hand at fixing up the wording of the standard appropriately. If you do try this exercise, I   believe you'll find you're inevitably led into using the language of sets, not bags, in order to get around the errors and ambiguities.

</quote>

regards,
Lauri Pietarinen Received on Tue Nov 12 2002 - 14:12:26 CET

Original text of this message