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: Counting propositions

Re: Counting propositions

From: Mikito Harakiri <mikharakiri_at_iahu.com>
Date: Tue, 22 Jun 2004 12:40:31 -0700
Message-ID: <h60Cc.24$da4.292@news.oracle.com>

"x" <x-false_at_yahoo.com> wrote in message news:40d884f8$1_at_post.usenet.com...
> **** Post for FREE via your newsreader at post.usenet.com ****
> > Let's go through the list:
> >
> > AVG - nonfundamental, can be expressed in terms of SUM
> > STDDEV = SQRT(VARIANCE)
> > VARIANCE = (SUM(x*x)-(SUM(x)*SUM(x))/SUM(1))/(SUM(1)-1)
> >
> > Do you need mere examples to be convinced that there are only 4
> fundamental
> > aggregate operators?
> > 1. SUM = "+"*
> > 2. MIN = "/\"*
> > 3. MAX = "\/"*
> > 4. LIST = "||"*
>
> Nonsense.
> SUM([1])=1.
> COUNT([1,2,3,4])=4 !=SUM([1,2,3,4]).
SUM(1) is abbreviation for "select SUM(1) from T"

In other words "1" in SQL is a function that maps column value x into 1 for all x.

In order to calculate "Count([1,2,3,4])" (where I deliberately changed the case in order to avoid confusion with SQL syntax) we first apply function f:x->1 to each element of the bag. Therefore,

Count([1,2,3,4]) = Sum([f(1),f(2),f(3),f(4)])=Sum([1,1,1,1]) Received on Tue Jun 22 2004 - 14:40:31 CDT

Original text of this message

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