| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Enforcing functional dependecy constraints
x wrote:
> "David Cressey" <david.cressey_at_earthlink.net> wrote in message
> ...
> This is the standard theoretical decomposition.
> How the AB->C is enforced ?
>
>
>>Do you have a different answer?
It would be nice to avoid b) and c), in order to avoid triggers.
I think d) is a problem because because producing the view R could fail with a 'duplicate' (A,B) value. How would one decide which value to use unless there were 'inter-table' constraints/triggers on S and T?
If the above is right, does it mean that most or all current SQL products would force one to use triggers? That seems a shame to me. Maybe some of them allow a foreign key to reference a superkey which would seem to work for this case. I've seen it argued that the referenced value ought not to be limited to a key in the first place, which makes sense to me.
A quick search seems to indicate that sql server wants a primary key reference, db2 wants a candidate key reference. I'm not sure about Oracle. Mysql seems to want not only a candidate key, but an index on both tables which seems bizarre on the face of it. All of them seem to muddle the notion of a key with physical indexes.
If I'm seeing this right, that would explain why there seems to be so much talk of triggers and elaborate constraints in the SQL world.
Personally, I think I like a)'s schema the best but I think that implementing such a basic set of facts and FD's is more complicated than
it ought to be.
cheers,
p
Received on Mon Dec 12 2005 - 11:06:47 CST
![]() |
![]() |