我做错什么了? (从表中找到FD) [英] What did I do wrong? (Find FD from table)

查看:62
本文介绍了我做错什么了? (从表中找到FD)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是表格收入:

Here is the table Income:

这是我的答案:

服装->城市

服装->人口

价格- >产品

价格->服装

价格->城市

价格->人口

城市->人口

人口->城市

,但实际上答案是:

(产品,客户)->价格

(product, costumer) -> price

服装->城市

城市->人口

消费者->人口

我做错了什么?我一直在用他的方法: https://www.youtube.com/watch?v= ddOP5D4fagg

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

推荐答案

我们说FD(功能依赖)表达式S-> T具有行列式 <属性S的em> set 和属性T的确定的 set 。它表示S的给定子值出现在给定的关系值或变量/模式中,并且总是相同对于S-> {A},我们可以说S->A。对于{A}-> T,我们可以说A-> T。

We say that a FD (functional dependency) expression 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/schema always with the same subtuple value for T. For S -> {A} we can say S -> A. For {A} -> T we can say A -> T.

给定一个关系,我们说FD在其中持有 FD或满足于它或是真的,或者(粗略地)存在于 FD中(或粗心地)拥有 FD。 FD说的是真的。可以使用关系值/变量/模式的属性表示的每个FD都将保持或不保持。

Given a relation, we say that a FD "holds in" it or "is satisfied by" it or "is true" in it or (sloppily) "is in" it or (sloppily) it "has" a FD when what the FD says is true about it. Every FD that can be expressed using attributes of a relation value/variable/schema will either hold or not hold.

我们可以找到所有保持的FD S-> T通过将属性集的每个子集检查为S并将属性的每个子集检查为T来建立关系。 S是T的超集的FD必须成立并且被称为琐碎的。

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

我们可以通过检查每个属性集的子集为S,每个属性为T。也有算法。 (然后查找所有持有的FD:FD S-> {}保持不变&是否可以从FD S-> A中找到S-> T表示具有多个元素的T。)

We can find all the FDs S -> A that hold in a relation by checking every subset of the set of attributes as S with every attribute as T. There are also algorithms. (Then to find all FDs that hold: FDs S -> {} hold trivially & whether S -> T for T with multiple elements can be found from the FDs S -> A.)

以下是一些捷径:集合确定自己。如果S-> T,则S的每个超集确定T的每个子集。如果S不确定T,则S的任何子集都不确定T的任何超集。如果一个集合在每个元组中都有不同的值子行(因此, 唯一),然后确定每个集合。 {}->当每个元组具有相同的T子行值时为T。

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 (so it is "unique") then it determines every set. {} -> T when/iff every tuple has the same T subrow value.

给出一些持有的FD,阿姆斯特朗公理生成所有FD。那也必须成立。后者称为前者的关闭。一组生成一定闭合的FD称为封面。从封面中删除任何FD得出的封面不是封面,封面是最小或不可约的。

Given some FDs that hold, Armstrong's axioms generate all FDs that must also hold. The latter is called the "closure" of the former. 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".

通常,我们不被要求封闭所有保存在模式中的FD,因此我们被要求关闭/减少。给他们一个规范的掩护。通常,如果我们只知道在某个模式中保存的一些 FD,那么我们就不知道它的关闭就是所保存的所有FD。

Usually we are not asked to give a closure for all FDs that hold in a schema, we are asked to give a canonical cover for them. In general if we only know some FDs that hold in a schema then we don't know that its closure is all the FDs that hold.

您只列出了拥有一个行列式和一个确定属性的FD;您没有列出任何具有较大决定因素的FD。但是,如果您想提供正确的答案,那么您需要告诉我们准确是什么问题。 (并且请确认正确答案是完全。)

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.)

这篇关于我做错什么了? (从表中找到FD)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆