Path: news.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!newsfeed.news2me.com!canoe.uoregon.edu!logbridge.uoregon.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
From: lauri.pietarinen@atbusiness.com (Lauri Pietarinen)
Newsgroups: comp.databases.theory
Subject: Re: Requirements for update languages?
Date: 12 Nov 2002 05:12:26 -0800
Organization: http://groups.google.com/
Lines: 54
Message-ID: <e9d83568.0211120512.2b06ec2f@posting.google.com>
References: <m2k7jo87eh.fsf@pcwi1068.uni-muenster.de> <aqh5o4$ukg$1@sp15at20.hursley.ibm.com> <m2wunmmkda.fsf@pcwi1068.uni-muenster.de> <aqoak9$10ki$1@sp15at20.hursley.ibm.com>
NNTP-Posting-Host: 213.243.157.83
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1037106746 26650 127.0.0.1 (12 Nov 2002 13:12:27 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 12 Nov 2002 13:12:27 GMT
Xref: newsfeed1.easynews.com comp.databases.theory:23602
X-Received-Date: Tue, 12 Nov 2002 06:12:11 MST (news.easynews.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
