Re: Plural or singular table names

From: Marshall Spight <mspight_at_dnai.com>
Date: Thu, 04 Sep 2003 04:43:51 GMT
Message-ID: <bqz5b.263499$Oz4.69861_at_rwcrnsc54>


"Bob Badour" <bbadour_at_golden.net> wrote in message news:m6y5b.465$EE4.45821030_at_mantis.golden.net...
> "Marshall Spight" <mspight_at_dnai.com> wrote in message
> news:0sv5b.163742$2x.45738_at_rwcrnsc52.ops.asp.att.net...
> > But I'm unable to figure out how what you're saying might apply to
> > a relcon. Can you give me an example of an operation on one or
> > two relational values and an associated operator that would be
> > affected by the presence of a candidate key?
>
> The candidate keys affect the type of the result of just about every
> operation. Consider two ternary relations that each have attributes A, B,
> and C where the only candidate key of one relation is { A } and the only
> candidate key of the other relation is { C }. Consider the result of the
> project operation over { B, C }
>
> The candidate key of the project will be { B, C } for the first relation and
> { C } for the second relation. The results have different types. Now, it is
> possible that both relations contain the same set of tuples where { C } is
> incidentally unique for the first relation and where { A } is incidentally
> unique for the second. Even though the set of tuples in both operands and
> the set of tuples in both results are the same, the types differ.

The question being discussed is whether relation values have constraints, and in particular whether they have key constraints. I can see how the above explanation works if I have already accepted the idea that relation values have keys, but I do not see how it leads me to accept that idea if I haven't already.

You also now seem to be including the idea that constraints are part of the type. This also strikes me as unusual.

> > I guess I'm also assuming (much less solidly) that when you say
> > candidate key, here, you are saying something *beyond* the
> > fact that the rows must be unique. We would all agree (I hope!)
> > that the members of a relation value are unique; I generally
> > consider that part of the definition of relation, rather than
> > that the definition includes the requirement of at least one
> > candidate key, and that uniqueness is a consequence of
> > that key.
>
> The two definitions are equivalent. Every relation having at least one
> irreducible key implies unique tuples and vice versa.

The two definitions have the same effects, but they are not equivalent. They are especially not equivalent when considering the question of whether relation values have keys or not, because one of them assumes that relation values have keys and the other doesn't.

Also, I can see how:

every relation has a key -> unique tuples

but I don't see how

unique tuples -> every relation has a key.

Foldoc gives this definition for constraint: "A Boolean relation, often an equality or ineqality relation, between the values of one or more mathematical variables (often two)."

Also, I checked a few places in TTM, but could only find references to constraints on variables (database or relation variables) and constraints on types. (Admittedly, this is just appeal to authority, and not definitive.)

Marshall Received on Thu Sep 04 2003 - 06:43:51 CEST

Original text of this message