Re: constraints in algebra instead of calculus

From: paul c <toledobythesea_at_oohay.ac>
Date: Fri, 15 Jun 2007 14:10:59 GMT
Message-ID: <T5xci.29187$NV3.2421_at_pd7urf2no>


Jan Hidders wrote:
> On 15 jun, 04:46, paul c <toledobythe..._at_oohay.ac> wrote:

>>  ...
>>R is relvar name, A is candidate key, B is set of all the non-key
>>attributes.
>>
>>1. R1 := R GROUP ( {A} as gA )
>>2. R2 := R1 GROUP ( {B} as gB)
>>3. R3 := R GROUP ( {B} as gB )
>>4. R4 := R3 GROUP ( {A} as gA )
>>5. R5 := R4{gB} <AND> R2
>>6. R6 :=  UNGROUP ( R5 UNGROUP  (gB)) (gA) )
>>7. (constraint) R6 = R

>
>
> You can simplify that a bit:
>
> R1 := (R{B}) GROUP {B} AS gB
> R2 := (R GROUP {B} AS gB){gB}
> constraint: R1=R2
>
> -- Jan Hidders
>

That's clever, thanks very much.

p Received on Fri Jun 15 2007 - 16:10:59 CEST

Original text of this message