Re: Extending my question. Was: The relational model and relational algebra - why did SQL become the industry standard?
Date: Thu, 13 Feb 2003 12:37:11 -0800
"Lauri Pietarinen" <lauri.pietarinen_at_atbusiness.com> wrote in message
> < 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/ >
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 - 21:37:11 CET