Path: news.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail
From: Steve Kass
Newsgroups: comp.databases.theory
Subject: Re: Extending my question. Was: The relational model and relational
algebra - why did SQL become the industry standard?
Date: Fri, 14 Feb 2003 00:31:35 -0500
Organization: MindSpring Enterprises
Lines: 138
Message-ID:
References: <3e48d741.0@news.ruca.ua.ac.be> <3e4ad2b8.0@news.ruca.ua.ac.be> <3E4B8137.2080204@atbusiness.com> <3GU2a.12$O%2.121@news.oracle.com>
NNTP-Posting-Host: 44.a4.23.1d
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Server-Date: 14 Feb 2003 05:29:57 GMT
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
Xref: newsfeed1.easynews.com comp.databases.theory:24762
X-Received-Date: Thu, 13 Feb 2003 22:29:55 MST (news.easynews.com)
Mikito Harakiri wrote:
>"Steve Kass" wrote in message
>news:b2h9jb$p0h$1@slb4.atl.mindspring.net...
>
>
>>I didn't read the whole thread, but in the right context, the
>>bags are functions, and intersect, union, etc. are all well-defined.
>>
>>
>
>I don't agree that the matter is "context dependent". One either has a model
>with a consistent set of operations that users like, or not.
>
>
Whether "users like" something has nothing to do with its mathematical
consistency.
>
>
>>Definition: A multiset M over a domain U is a function with
>>domain U and range the set of non-negative integers.
>>
>>We say that the element x is in M if M(x) > 0.
>>We say that the element x appears in M with multiplicity k, if M(x) = k
>>We say that M = M' for two multisets M and M' on domains U and U'
>>respectively if M(x) = M'(x) for all x in the intersection of U and U' and
>>M(x) = 0 when x is not in U, and M'(x) = 0 when x is not in U'.
>>
>>Functions are well-defined in terms of sets also, subsets of U x Z where
>>(x,n) and (x,m) both in a function f implies n = m (single-valuedness).
>>
>>It makes no sense to take the union of two functions, but it does make
>>
>>
>sense
>
>
>>to take the sum (union all), min (intersection), and other operations.
>>
>>
>
>Union is redundant in multiset model anyway. It is a distinct "union all".
>"Distinct" is a grouped aggregate.
>
>
>
>>Just define things carefully and it's all much easier. If you think the
>>intersection
>>of two multisets, one containing two S's and one containing 3 should be a
>>multiset containing 6 S's, then see if it the product operation f*g(x) =
>>f(x)*g(x)
>>has useful properties for modeling the real world.
>>
>>
>
>With my definition
>
>select name from e1
>intersect
>select name from e2
>
>is identical to
>
>select e1.name from e1, e2
>where e1.name = e2.name
>
>This is not true with the "min" definition.
>
>
I didn't say it was. I said that "intersect" as you define it
is given by the product of the functions. "intersect" the way SQL
defines it is given by the minimum of the functions. They are both
valid definitions, and if one is better for you, create a language
for multiset manipulations that uses the word intersect for that one.
Because of its use for sets, intersect (I think) gives the impression
of, well, intersection, not product. I just don't see why you'd call
the operation defined by f op g (x) = f (x) * g(x) "intersect" instead
of product.
>
>
>>I don't see why you
>>would
>>call something like that intersect, though.
>>
>>
>
>See the above.
>
>
>
>>As for what laws hold for multisets, you just go figure out which ones do.
>>
>>
>
>Found one that doesn't hold for multisets:-(
>
>select e1.name from (
> select e1.name, e2.name from emp e1, emp e2
>)
>
>is not the same as
>
>select name from emp
>
>More concisely:
>
>PROJECT*POWER != 1
>
>
>
Right. But there's no problem here, just as there's no problem
with the fact that matrix multiplication is not commutative, even
though matrices can be considered a generalization of a set where
the multiplication is commutative.
For the record, the inverse operation of what you are calling power
is relational division.
Let emp be a multiset. Let emp X emp be the cartesion product of
two copies of emp. Then (emp X emp) / emp is emp, if we read /
to mean relational division. The mathematical analogy is the factor
operation where you factor a group by a normal subgroup to obtain
cosets.
Steve
>
>
>
>
>
>