问题
I'm quite new to databases / SQL and have a practice question "what are the functional dependencies shown above?"
From what I understand there are 4 dependencies: trivial functional, full functional, transitive and multivalued.
Would the question be expecting all four types to be listed or only the first two?
If only the first two then is there a special name for them or are they 'dependencies' whereas the first two in the list are functional dependencies?
Many thanks
回答1:
There are various kinds of dependencies. The most common, which play a role in normalization, are functional, multi-valued and join.
For each of those three kinds a dependency can be trivial.
You were asked for FDs. FDs, MVDs & JDs are three different things. (Although an FD has an associated MVD and an MVD has an associated JD.)
A dependency can hold or not hold in a given table value. It can also hold or not hold in a given table variable, which means that it holds or does not hold (respectively) in every value that can arise for the variable given the business rules.
A FD is trivial when its determined set is a subset of its determing set. Any trivial FD you can make using the attributes of a relation holds in it.
A partial FD that holds in a relation is one where dropping any determining attributes can give another FD that holds in that relation. The FDs that hold in a relation that are not partial are full.
A transitive FD X -> Z that holds in a relation is one where there is an attribute Y in the relation where X -> Y and Y -> Z hold in the relation but Y -> X does not hold. The FDs that hold in a relation that are not transitive are non-transitive.
An FD that holds can be zero or more of trivial, full and/or transitive independently. So when asked to list all FDs it doesn't make sense to list them by those kinds.
In your assignment "shown" means "shown to hold". You need to ask your instructor what FDs you are supposed to list given an example table value. Maybe you are supposed to list only the FDs that are explictly communicated to hold by having some determined subtuple only appear with the same determining subtuple. Maybe you are supposed to list all the FDs that hold given that the explicit ones do. Maybe it's one of those cases except you are not supposed to list the trivai ones.
回答2:
I can't speak for the questioner, but I would expect to see the non-trivial functional dependencies, and would be happy to see transitive dependencies listed though they can be derived from the former. Listing trivial FDs without indicating them as such might indicate that the student doesn't understand the difference. I wouldn't expect MVDs to be listed if the question only mentions FDs.
If in doubt, list all 4 types, making sure to indicate the nature of each.
来源:https://stackoverflow.com/questions/37067668/listing-functional-dependencies-include-transitive-or-multivalued