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: Extending my question. Was: The relational model and relational algebra - why did SQL become the industry standard?

Re: Extending my question. Was: The relational model and relational algebra - why did SQL become the industry standard?

From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Thu, 13 Feb 2003 12:37:11 -0800
Message-ID: <irT2a.10$O%2.40@news.oracle.com>


"Lauri Pietarinen" <lauri.pietarinen_at_atbusiness.com> wrote in message news:3E4B8137.2080204_at_atbusiness.com...
> < quotes from book Hector Garcia-Molina, Jeffrey D. Ullman, and
> Jennifer Widom, DATABASE SYSTEM IMPLEMENTATION>
>
> [Relational] algebra was originally defined as if relations were sets
> [sic!--italics added].Yet relations in SQL are really bags ... Thus, we
> shall introduce relational algebra as an algebra on bags.
>
> ...
>
> For instance, you may have learned set-theoretic laws such as A
> INTERSECT (B UNION C) = (A INTERSECT B) UNION (A INTERSECT C), which is
> formally the "distributive law of intersection over union." This law
> holds for sets, but not for bags.
>
> < quotes from book/ >

Therefore, the idea here is that Set Algebra is superior to Bag Algebra? Not for aggregates:

PROJECTION*AGGREGATE != AGGREGATE*PROJECTION for example

select distinct S from (
  select distinct SUM(SAL) from emp
)

is not the same as

select distinct SUM(SAL) from (
  select distinct SAL from emp
)

where i'm using SQL with the "distinct" keyword merely as a surrogate for true relational syntax ("distinct" is redundant after aggregate operation, of course). Received on Thu Feb 13 2003 - 14:37:11 CST

Original text of this message

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