ER模型对功能依赖性解决方案的解释 [英] Explanation of ER model to functional dependencies solution

查看:96
本文介绍了ER模型对功能依赖性解决方案的解释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试了解将ER模型转换为功能依赖性的一项练习的解决方案.

I am trying to understand solution on one exercise that translates ER model to functional dependencies.

正如您在上面看到的,我们只有关系名称,除此之外,没有别的,通过解决方案,它们以某种方式得出结论

As you can see above, we only have relation names and nothing else besides that, and by solution, they somehow come up to conclusion that

母亲,女儿→父亲

mother, daughter → father

父亲,女儿→妈妈

father, daughter → mother

母亲,儿子→父亲

mother, son → father

父子→妈妈

此外,我们还可以推断出其他f个依赖项,以更准确地表示现实世界:

And that moreover we can infer additional f dependencies to represent real world more accurately:

母亲,儿子→父亲

mother, son → father

父子→妈妈

我在这里不明白的是,我们如何仅通过查看关系名称就可以将转换基于功能依赖关系进行,因为我总是在从ER模型转换为关系模型时,通过查看属性名称来完成转换.这个练习中是否可能出了点问题,或者任务提供者只是试图让我们在第一次学习时(即通过进行更多的教育)使我们更接近于我,对功能依赖的翻译?

What I don't understand here is how can we base our translation to functional dependencies by just looking at the relation names, since I always when I did translation from ER model to relational model, I did it by looking at attribute names. Is it possible that there is something wrong in this exercise, or that the task giver was just trying to make us translation to functional dependencies more closer to me as a student first time looking at it (i.e. by making in more educational)?

推荐答案

TL; DR

正如您在上面看到的,我们只有关系名称,除此之外没有其他

As you can see above, we only have relation names and nothing else besides that

好吧,有几行,每行都有一个名称& ;;数字或字母.

Well, there are some lines, each with a name & a digit or letter.

作业没有什么奇怪的.转到您的教科书和准确找出每个技术术语和图形元素的意思.(特别是您可能对关系"或基数标签的含义感到困惑.)解决方案的产生方式如下.

There isn't anything strange about the assignment. Go to your textbook & find out exactly what every technical term & graphic element means. (In particular you might be confused by the meaning of "relationship" or your cardinality labels.) How the solution arises follows.

ERM中的R(对于实体关系模型)代表关系",就像在n元关联中一样.类似地,RM中的R(对于关系模型)按照其在数学中的连接含义使用关系"作为n元关系/关联和关系.如此相关/关联的一组值的元组,这些元组参与或满足这种关系.但是这些ER&RM关系"不是参与项或FK(外键),它们通过方法&声称是ER或关系型但又不是关系型的演示文稿.

The R in ERM (for the Entity-Relationship Model) stands for "relationship" as in an n-ary association. Similarly the R in RM (for the Relational Model) uses "relation" per its connected meanings in mathematics as an n-ary relationship/association & as a set of tuples of values that participate in or satisfy such a relation, that are so related/associated. But these ER & RM "relationships" are not participations or FKs (foreign keys), which get called "relationships" or "relations" by methods & presentations that claim to be ER or relational but are not.

Chen ER图的每个实体类型都有一个方框,每个关系类型都有一个菱形&每次参与一行.一行上的名称为参与关系提供了关系中的属性.一行上的1或N标签会提供该参与的基数信息.

A Chen ER diagram has a box per entity type, a diamond per relationship type & a line per participation. A name on a line gives the attribute in the relationship for that participation. A 1 or N label on a line gives cardinality information for that participation.

每个ER实体和关系类型得到一个代表关系.因此,每个框与一个关系钻石每行FK.FD(功能依赖性)适用于关系.因此可以说,FD适用于关系.

Each ER entity & relationship type gets a representing relation. Hence a relation per box & diamond & a FK per line. A FD (functional dependency) applies to a relation. So we can say that a FD applies to a relationship.

大概该图的关系/关系如下:

Presumably the diagram's relationships/relations are like:

-- man [son] is the son of man [father] & woman [mother]
isSon(son, father, mother)
-- woman [daughter] is the daughter of man [father] & woman [mother]
isDaughter(daughter, father, mother)

信息建模方法和技术的样式很多.图表基数标签.您的图表似乎是Chen真正的ER风格之一.在关系类型中按实体类型参与的基数标签说明有多少个该类型的实体可以参与或共享其他参与者类型的给定实例/子对象在可能出现的所有情况下.1表示正一个&N表示一个或多个.n元关系基数是n个此类参与基数的序列,即"X:Y:..."或"X to Y to ...".

There are many styles of information modelling methods & diagrams & cardinality labels. Your diagram seems to be one of the Chen styles of true ER. A cardinality label on a participation by an entity type in a relationship type says how many entities of that type can participate with or share a given instance/subtuple of the other participant types over all situations that can arise. A 1 means exactly one & an N means one or more. An n-ary relationship cardinality is a sequence of n such participation cardinalities, "X:Y:..." or "X to Y to ...".

请注意,这样的序列假定实体/属性的特定顺序.请注意,对于二阶关系,N:1表示相反的顺序为1:N.(当/iff isMother(母亲,孩子)为1:N时, hasMother(孩子,母亲)为N:1.)请注意,X:Y中的每个实体/属性:...断言其他的给定"或一个给定"子元.该一个"不是来自基数标签.标签是从短语插入的.特别是它不是来自二进制N:1或1:N中的1.

Notice that such a sequence assumes a certain order of entities/attributes. Notice that for a binary relationship N:1 for one order means 1:N for the reverse order. (hasMother(child, mother) is N:1 when/iff isMother(mother, child) is 1:N.) Notice that every entity/attribute in X:Y:... asserts about "a given" or "one given" subtuple of others. That "one" is not from a cardinality label. It's from the phrase that the label is plugged into. In particular it's not from a 1 in a binary N:1 or 1:N.

从您的台词中,我们得到:

From your lines we get:

isSon
    N sons participate with a given father-mother pair
    1 father participates with a given son-mother pair
    1 mother participates with a given son-father pair
isDaughter
    N daughters participate with a given father-mother pair
    1 father participates with a given daughter-mother pair
    1 mother participates with a given daughter-father pair

(二进制X:Y通常被粗略地表述为"X实体具有另一个Y,而Y实体具有另一个X".它的意思是给定的第一个出现时,另一个Y与另一个Y".给定的第二个与另一个X一起出现."该短语不能推广到n元关系或X:Y:....(给定的第n个实体与多少个事物一起出现?),使用带有第n个实体的第n个字母,第一个出现的X带有其他给定的子集,而第二个出现的Y带有其他给定的子集."这是n =的Chen nary解释2.您可能认为我们可以使用X:Y:...来表示给定的第一个出现带有其他X个子元素,而给定的第二个出现带有Y个其他子元素,而...".并没有那么有用,并且与二进制X:Y的正常含义相矛盾,因为它表示的是Y:X的正常含义.)

(Binary X:Y is often sloppily expressed as "X entities have Y of the other & Y entities have X of the other". It is intended to mean "a given 1st appears with Y of the other & a given 2nd appears with X of the other". That phrasing doesn't generalize to n-ary relationships or X:Y:.... (A given nth entity appears with how many of what?) That sloppy expression also intends to mean, using the nth letter with the nth entity, "X of the 1st appear with a given subtuple of the others & Y of the 2nd appear with a given subtuple of the others". Which is the Chen n-ary interpretation for n=2. You might think that we could use X:Y:... to mean "a given 1st appears with X subtuples of others & a given 2nd appears with Y subtuples of others & ...". However, that turns out not to be as useful & it contradicts the normal meaning of binary X:Y by taking it to mean what Y:X normally means.)

这种特殊形式的基数约束恰好是在告诉我们一些直接的有关持有&的FD(功能依赖项)的信息.不要坚持代表关系.观察1s& ;;Ns与一些保存&的FD并联.不要持有:

This particular form of cardinality constraint happens to tell us something rather directly about some FDs (functional dependencies) that hold & don't hold in the representing relations. Observe lines with 1s & Ns paralleling some FDs that hold & don't hold:

isSon
    {father, mother} → {son} does not hold
    {son, mother} → {father}
    {son, father} → {mother}
isDaughter
    {father, mother} → {daughter} does not hold
    {daughter, mother} → {father}
    {daughter, father} → {mother}

对于每个现实世界"的FD,我们可以确定的内容取决于我们认为包含&每个关系/关系的确切含义是-它的元组成员条件/条件-它的(特征)谓词.约束-包括FK和FD-由谓词&可能出现的情况/状态.反过来,这取决于说明书中使用的词语的含义,包括表达谓词和名词的含义.业务规则.

What we can determine about FDs per "the real world" depends on what we consider that to encompass & what exactly each relationship's/relation's meaning is--its tuple membership condition/criterion--its (characteristic) predicate. Constraints--including FKs & FDs--are determined by the predicates & the situations/states that can arise. In turn that depends on the meanings of words used in the specification including those expressing the predicates & business rules.

如果以上谓词涉及生物学子公司,女儿,那么我们可以合理地预期给定的基数和还期望 {son}→{父亲,母亲} & {女儿}→{父亲,母亲} .(请注意,这些FD意味着以上确定 {father} & {mother} 和其基数标签的FD.)

If the predicates above involve biological sons & daughters then we can reasonably expect the given cardinalities & also expect that {son} → {father, mother} & {daughter} → {father, mother}. (Note that those FDs imply the above FDs that determine {father} & {mother} & their cardinality labels.)

但是对于其他谓词&业务规则(根据表达方式表达的意思以及其中的词语含义)&关于现实世界"的概念,我们可能会有不同的FD.这完全取决于父亲",母亲",儿子"和父亲"的确切意图.女儿",或就此而言,人"&女人",以及您所假定的相关规则,是指您的申请可能出现的情况/状态-婚姻,离婚,领养,非继承,育儿,死亡等.以及您从中招募的人什么时候等.真的需要弄清楚.

However for other predicates & business rules (per what expressions express them & what the words in them mean) & notions of "the real world" we might have different FDs. It all depends on what exactly is intended by "father", "mother", "son" & "daughter", or for that matter "man" & "woman", and what associated rules you assume re what situations/states can arise for your application--marriage, divorce, adoption, disinheritance, parenting, death, etc & just what people you are drawing from & when, etc. One really needs to be really clear.

但是您没有明确给出谓词或业务规则.(或者是用于解释图表的图例.)因此很难说出其他未隐含的FD可以保留还是不保留什么.

But you don't clearly give the predicates or the business rules. (Or a legend for interpreting your diagram.) So it's hard to say what other non-implied FDs might hold or not hold.

所以作业没有什么奇怪的.

So there isn't anything strange about the assignment.

PS当您陷入困境时,请转到教科书上.找出所有东西的确切含义&提出一个问题,询问您最先了解或遵循特定定义,公理/假设,定理/事实或算法/方法/过程/启发式的地方.这个问题不是来自创造性地被卡住的.在这里,您应该在教科书中机械地应用一种方法.

PS When you are stuck go to your textbook & find out exactly what everything means & ask a question about where you are first stuck understanding or following a specific definition, axiom/assumption, theorem/fact or algorithm/method/process/heuristic. This question is not from being stuck creatively; here you are supposed to mechanically apply a method in your textbook.

PS 与ER图的关系架构/基数差异

这篇关于ER模型对功能依赖性解决方案的解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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