| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Requirements for update languages?
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
![]() |
![]() |