Re: more algebra
Date: Sat, 10 Apr 2010 21:49:46 -0700 (PDT)
Message-ID: <e04aa1ca-bfa0-4409-b0b7-fff9b935bf85_at_j21g2000yqh.googlegroups.com>
On Apr 6, 5:05 pm, paul c <toledobythe..._at_oohay.ac> wrote:
> ( r GROUP ( { N } AS n ) ) = ( EXTEND r ADD ( RELATION { TUPLE { N
> } AS n ) { K, n }
> will be 'true' iff r satisfies the key constraint.
> I admit the above is pretty ugly but underneath it's pretty simple.
Maybe, if you can find natural language to make it clear that this
captures the idea of key constraint.
You don't need to use COUNT or GROUP/nesting.
(Ironically the latter, like the former,
requires an extension to the original algebra.)
"A k-subtuple can't appear with a second n-subtuple."
Using calculus (with named arguments):
FALSE =
EXISTS k1, ..., n1, ..., _n1, ... :
r(k1 as k1, ..., n1 as n1, ...)
AND r(k1 as k1, ..., _n1 as n1, ...)
AND n1 NOT= _n1 AND ....
Using algebra (with parallel structure to above):
DUM =
( ( r JOIN (r RENAME { n1 TO _n1, ...}))
RESTRICT { n1 NOT= _n1, ...}
){ALL BUT}
> But as we know, sql is not very rigourous [...]
> So I think the simple user interface is a big trap.
philip Received on Sun Apr 11 2010 - 06:49:46 CEST