What did I do wrong? (Find FD from table)

两盒软妹~` 提交于 2020-01-01 22:28:28

问题


Here is the table Income:

Here is my answer:

costumer -> city

costumer -> population

price -> product

price -> costumer

price -> city

price -> population

city -> population

population -> city

but actually the answer is:

(product, costumer) -> price

costumer -> city

city -> population

costumer -> population

What did I do wrong? I have been use by his method: https://www.youtube.com/watch?v=ddOP5D4fagg


回答1:


We say that a FD (functional dependency) S -> T has a "determinant" set of attributes S and a "determined" set of attributes T. It says that a given subtuple value for S appears in a given relation (value or variable) always with the same subtuple value for T. When S -> {A} we say S -> A.

We say that a FD "holds in" a table or "is in" a table or "is satisfied by" a table or a table "has" an FD when what the FD says is true about the table.

We can find all the FDs S -> T that hold in a table by checking every subset of the set of attributes as S with every subset of attributes as T. FDs where S a superset of T must hold and are called "trivial".

We can find all the FDs S -> A that hold in a table by checking every subset of the set of attributes as S with every attribute as T. There are also algorithms.

Here are some shortcuts: A set determines itself. If S -> T then every superset of S determines every subset of T. If S doesn't determine T then no subset of S determines any superset of T. If a set has a different subrow of values in every tuple then every set determines it & it determines every set.

Given some FDs that hold, Armstrong's axioms generate all FDs that hold. The set of all FDs that hold is called the "closure". A set of FDs that generates a certain closure is called a "cover". A cover is "minimal" or "irreducible" when removing any FD from it gives a set that is not a cover. A minimal/irreducible cover with every determinant unique is "canonical". Usually we are not asked to give a closure, we are asked to give a canonical cover.


You only listed FDs that hold that have one determinant and one determined attribute; you didn't list any of the FDs that hold that have larger determinants. But if you want to produce the right answer then you need to tell us what the question was exactly. (And please confirm what the right answer was exactly.)



来源:https://stackoverflow.com/questions/42259232/what-did-i-do-wrong-find-fd-from-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!