![]() | |
#11
| ||||
| ||||
|
|
say A join_K A=A instead, without renaming attributes.. We want to express K_1=K_2 => (A\K)_1=(A\K)_2 Please define this notation in terms of common operators. Preferably by equivalent formal notation not natural language. |
|
I am interested in knowing what you are trying to say and helping you. But your writing always consists of vague phrases of which it is difficult to impossible to identify or guess the referents. |
|
This is exacerbated by misconceptions and histrionics. |
|
The way to be clear is to put in the effort to force yourself to be clear, instead of settling for being unclear. |
#12
| |||
| |||
|
|
( 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. |
|
But as we know, sql is not very rigourous [...] So I think the simple user interface is a big trap. |
#13
| |||
| |||
|
|
On Apr 6, 5:05 pm, paul c <toledobythe... (AT) oohay (DOT) 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. If we are precise it's a bit more complicated: ( r GROUP ( { n1, ... } AS n ) ) = ( EXTEND r ADD RELATION { TUPLE { n1 AS n1, ... } } AS n ) { k1, ..., n } 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} ... |
#14
| |||
| |||
|
|
On Apr 6, 5:05 pm, paul c <toledobythe... (AT) oohay (DOT) ac> wrote: ... But as we know, sql is not very rigourous [...] So I think the simple user interface is a big trap. I don't understand this. ... |
|
By the way it is important to have a keyword for keys. Although a non-keyword expression can be evaluated as a constraint there is in general no way to for a dbms to tell that a given constraint implies a key constraint. And it needs to know this for important optimizations (of other than just relational expressions). Although I sympathize with you I suggest that it is hopeless to choose the form of your specification on the basis of hoping to circumvent incompetent programming. COUNT has a precise & simple definition, why not use it? Yes, competent designers and implementers use math. Yes, most designers and implementers work willy-nilly. This is true for all programming. |
![]() |
| Thread Tools | |
| Display Modes | |
| |