Re: Constraints and Functional Dependencies

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Mon, 26 Feb 2007 14:22:39 GMT
Message-ID: <P2CEh.1507$PV3.21663_at_ursa-nb00s0.nbnet.nb.ca>


Marshall wrote:
> On Feb 25, 9:56 am, paul c <toledobythe..._at_oohay.ac> wrote:
>

>>Marshall wrote:
>>
>>>...
>>>Hmmm. Can we express keyness otherwise? I can't think how.
>>>...
>>
>>I've long imagined that Codd would have defined it (as you also did) via
>>a cartesian product but some others like to use cardinality, eg., adding
>>a "count" operation to their theory.  My guess is that they see this as
>>something many implementations would want anyway.

>
> I don't know why exactly but I have this vague aversion
> to using aggregate operators in constraints. I think I'm doing
> premature optimization, and should probably slap my own
> wrist for it, but I can't shake the feeling that given two ways to
> write a constraint, one using an aggregate, and one not, one
> should use the form without the aggregate.
>
> Of course, I can imagine how enforcing constraints with aggregates
> could be trivially easy. And aggregates, especially count, being
> as transparent as they are, I'm probably doubly in the wrong.
>
> Now that you mention it, a constraint that said that the count of
> a relation projected over the candidate key attributes equals
> the count of the unprojected relation would enforce uniqueness;
> that is, would also serve as a key constraint.
>
> (Happily I managed to avoid the word "keyness" in this post.)

No, you are right to avoid avoidable aggregations. Elegance still counts for something. Received on Mon Feb 26 2007 - 15:22:39 CET

Original text of this message