Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Requirements for update languages?

Re: Requirements for update languages?

From: Lauri Pietarinen <lauri.pietarinen_at_atbusiness.com>
Date: 12 Nov 2002 15:31:28 -0800
Message-ID: <e9d83568.0211121531.58d090c6@posting.google.com>


But wait a minute!

> The other way to legitimate bags is a theory of distributions: each
> distribution is a generalization of a bag. Cartesian Product is just
> a product of 2 distributions. Given
>
> T1: {0->2} and T2: {1->1, 2->1}
>
> then
>
> T1*T2 = {<0,1> -> 2, <0,2> -> 2}
>
>
> Note, that aggregation fits naturally into distribution theory, and
> not
> into logic or set theory.

The same can be expressed in terms of sets as following:

The tables

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

have been converted into

                T1'         T2'          
                +---------+ +---------+  
                ¦ C1 ¦ Q  ¦ ¦ C2 ¦ Q  ¦  
                +----+----¦ +----+----¦  
                ¦ 0  ¦ 2  ¦ ¦ 1  ¦ 1  ¦  
                +---------+ ¦ 2  ¦ 1  ¦  
                            +---------+  
                                         
                                      

and with the help of an extra table

                                                     
                  N   
                +----+
                ¦ I  ¦
                +----¦
                ¦ 1  ¦
                ¦ 2  ¦
                ¦ 3  ¦
                ¦ 4  ¦
                ¦ 5  ¦
                ¦ etc...
                +----+
                     

we can write (using SQL...)

                SELECT T1'.C1, T2'.C2
                  FROM T1', 
                       T2', 
                       N N1,
                       N N2
                  WHERE T1'.Q <= N1.I AND
                        T2'.Q <= N2.I
                        

to get the required result.

Note however that T1' and T2' are sets and not bags so in my opinion Date's original argument stands.

regards,
Lauri Pietarinen Received on Tue Nov 12 2002 - 17:31:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US