识别功能依赖性 [英] identifying the functional dependencies

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

问题描述

我一直在阅读数据库设计,我从表中构建函数依赖图有困难。



我有下面的表。
每个销售人员由销售人员的编号标识,他们的销售活动是在表中每个月记录的



http://i.stack.imgur.com/2NXru.png



我做了以下假设:




  • 每个销售人员都有一个唯一的销售人员号码

  • 每个客户都有一个唯一的客户号码

  • 每个产品都有唯一的产品号码和说明




我想出了以下函数依赖关系图:



http://i.stack.imgur.com/XFndy.png



我的问题是:




  • 首先是创建fd的正确方法
  • 这是正确的吗?

解决方案

函数依赖通常不在图中表示。相反,他们通常表示为这样。 。 。

  A-> B 
B-> CD



或这样。

 销售人员号码 - > 销售人员姓名
客户号码 - > 客户名称

如果您的图表表示产品编号 - >你的图表是错误的。






函数依赖性回答了问题给定A的一个值,我可以确定一个且只有一个值B,其中A和B是属性集。让我们来看一个简单的例子。



给定产品编号的一个值,我们可以确定产品描述只有一个值吗?是。给定产品编号P1023-01,我们只能为产品描述确定一个值:A4纸。产品编号P1023-01从不与任何产品名称匹配,但A4纸。



为产品编号提供一个值,我们可以为已售出数量确定一个值吗?编号。鉴于产品编号P1023-01,我们可以为已售出数量确定两个不同的值:6和10.依赖关系产品编号 - >已售出数量在此关系中不成立。


I have been reading up on database design and I am having some difficulty constructing functional dependency diagrams from tables.

I have the following table. Each salesperson is identified by a salesperson’s number, and their sales activities are recorded for each month in the table.

http://i.stack.imgur.com/2NXru.png

I have made the following assumptions:

  • Each Salesperson has a unique salesperson number
  • Each Client has a unique client number
  • Each product has a unique product number and description
  • Each Customer has a unique sales persons that they deal with.

I have come up with the following functional dependencies diagram:

http://i.stack.imgur.com/XFndy.png

My questions are:

  • First of all is this correct way of creating a fd diagram?
  • Is this correct based upon the assumptions?

解决方案

Functional dependencies aren't usually expressed in a diagram. Instead, they're usually expressed like this . . .

A->B
B->CD

or like this.

"Salesperson number" -> "Salesperson name"
"Client number" -> "Client name"

If your diagram means that "Product number" -> "Quantity sold", then your diagram is wrong. Also, client number does not determine product number.


A functional dependency answers the question, "Given one value for A, can I determine one and only one value for B?", where A and B are sets of attributes. Let's look at a simple example.

Given one value for "Product number", can we determine one and only one value for "Product description"? Yes. Given the product number P1023-01, we can determine only one value for "Product description": "A4 Paper". Product number P1023-01 never matches up with any product name but "A4 Paper".

Given one value for "Product number", can we determine one and only one value for "Quantity sold"? No. Given the product number P1023-01, we can determine two different values for "Quantity sold": 6 and 10. The dependency "Product number" -> "Quantity sold" doesn't hold in this relation.

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

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