Re: Constraints and Functional Dependencies
Date: Sat, 24 Feb 2007 18:25:48 +0100
Message-ID: <45e0749a$0$321$e4fe514c_at_news.xs4all.nl>
Marshall wrote:
> mAsterdam wrote:
>> Hi Marshall,
>
> Hey dude! Long time no chat.
:-)
>> [snip intro] >> >>> With such a system, a relation R with attribute a (which I will >>> write as R(a)) having a as a foreign key into S(b) is expressed >>> as follows: >>> forall R(a): exists S(b): a = b >> Just to be sure notationally: the first colon reads >> ' it is true that ', the second ' such that it is true that ', right?
>
> That works, although I find the "it is true that" can usually
> be dropped. I'd probably read it as
>
> for all a in R there exists a b in S such that a equals b
>
> Something like that. With the understanding that
> "a in R" means "a value of the attribute named 'a'
> in the relvar R."
Thank you. Teletype is no substitute for a blackboard :-(
> Oh, that reminds me: there might be some use to
> expressing "constraints" on constants! They wouldn't
> be runtime constraints necessarily but they might
> be useful because of constraint propogation through
> views, for example. Instead of "constraints" they
> would be static properties of the constants that the
> compiler could verify. In fact, I generally quite like
> the idea of having a uniform way of specifying
> such properties, and having it be a separate concern
> whether the properites are checked statically or
> dynamically.
[snip suggestion to prime all instances]
> I am sensitive to the concern you mention, however I
> think it will be okay as is. (Although I admit I am not
> a teacher.)
Yes you are.
> Many constraints will not quantify over a
> given relatin more than once, for example, and they
> are a lot more readable without the primes.
Yes, that would be a serious drawback.
Since you are aware of the possibility for
confusion I trust you to emphasize the distinction
wherever it is necessary.
> Also,
> it's not that different than issues one runs into with
> SQL. When one says
>
> select * from R where a > b
>
> the "a > b" part is using attribute names as variables
> in an expression that is evaluated for every tuple in
> the relation.
Since when is that an argument? (for others: just kidding)
>>> What about candidate keys? Suppose we have a relation R with >> ... only the ... >> >>> *sets* of attributes A and B: R{A, B}.
>
> I debated whether to make that specific or not. Yes, the
> two are only equivalent if all attributes of R are in A union B.
>
> My intent is to express that with R{A, B}.
ISTM making this one explicit goes better with the minimalist approach.
The less is to be assumed ... grmpf!
I just saw a razor blade fly by :-)
Received on Sat Feb 24 2007 - 18:25:48 CET