views:

55

answers:

1

It seems to me there are other functional dependencies you may wish to declare (other than superkeys of course), but SQL provides no easy way to do so. Why is this?

+3  A: 

I don't know first-hand the answer as to "why" the SQL committee designed it the way they did, but I would assume the designers of SQL wanted only one primary key in a normal table. All other columns in a 3NF database design are functionally dependent on that key, and that key alone.

You can derive keys from the functional dependencies, and likewise you can derive functional dependencies from the superkeys. But only if they've been declared correctly, in a logically symmetrical way.

If you could declare both keys and FD's, then there would be a possibility of declaring a table in logical conflict with itself, which would break normalization.

It's better that the language provides only one mechanism, to avoid ambiguous declarations.

Bill Karwin