I'm reading the slides for Ch.7 of the Sailboat book: https://www.db-book.com/db7/slides-dir/PDF-dir/ch7.pdf and I've a hard time understanding what the authors mean by saying
A functional dependency is trivial if it is satisfied by all instances of a relation.
The wording is very different from Wiki's one, which is quite easy to understand.
A functional dependency FD: X → Y is called trivial if Y is a subset of X.
I tried looking at a worked example, but the condition "satisfied by all instances of a relation" really puzzles me.
Here's a relation taken from a university course: http://web.cs.ucla.edu/classes/fall04/cs143/solutions/ch7.pdf
| A | B | C |
|----|----|----|
| a1 | b1 | c1 |
| a1 | b1 | c2 |
| a2 | b1 | c1 |
| a2 | b1 | c3 |
In the solution for exercise 7.4, it's written that
The nontrivial functional dependencies are: A → B and C → B ...
For me, the instances of the relation are all tuples in the table, and each of them satisfies all of the above quoted functional dependencies. I don't understand why, using the Sailboat book's definition, that these functional dependencies aren't trivial.
Thanks for reading my question.
7.4 List all functional dependencies satisfied by the relation of Figure 7.21.
Answer: The nontrivial functional dependencies are: A → B and C → B, Exercises 85 and a dependency they logically imply: AC → B. There are 19 trivial functional dependencies of the form α → β, where β ⊆ α. C does not functionally determine A because the first and third tuples have the same C but different A values. The same tuples also show B does not functionally determine A. Likewise, A does not functionally determine C because the first two tuples have the same A value and different C values. The same tuples also show B does not functionally determine C.
We say that a FD (functional dependency) is satisfied (holds) in a given relation value iff/when what it states is true of the value. We say that a FD is satisfied (holds) in a given relation variable/schema iff/when it is satisfied (holds) in every value that can arise for it under given business rules.
Neither of your quotes gives a definition of when a FD is trivial in a given relation value or variable/schema, because they say "if" instead of iff/when. They only give a sufficient condition; they don't give a necessary & sufficient condition. So they don't tell you exactly when a FD is trivial for a given relation value or variable/schema.
They would be definitions if they said iff/when.
Let's take their "if" to mean iff/when.
"satisfied by all instances of a relation" is sloppy, unhelpful & misleading. It is phrasing meant to apply to a relation variable/schema. It is trying to say, would be satisfied even if you didn't know what constraints held, ie, would be satisfied even if no constraints held. It doesn't make much sense to use it given a relation value, since certain FDs do & don't hold for a given relation value at all times. (Clearly a value is constrained to be itself.)
A correct phrasing that applies to both variables/schemas & values is, satisfied given just the attributes, or, implied given just the attributes, or, able to be shown to be satisfied if all you knew were the attributes.
At the bottom of the slide it says
In general, α → β is trivial if β ⊆ α
This isn't a definition either, for the same reason, namely (ab)using "if" when iff/when is intended. But taking "if" as iff/when, you get a definition. It is essentially the same phrasing as your 2nd quote, with α for X, β for Y & ⊆ for subset of.
So the trivial FDs in your example value are exactly the ones X → Y where Y ⊆ X. A → B & C → B are not of that form so they are not trivial FDs of that value.
The exercise then goes on to discuss the non-trivial FDs that hold, applying the definition of an FD holding to that relation value. Some non-trivial FDs hold & some don't. But the trivial ones must hold by definition; they are the ones that hold no matter what value you are given with given attributes.