8

Can you guys show me how to get this ERD in 5th normal form? We did a class assignment yesterday where we had a real client come in and explain to us his need my group came up with this model I am trying to take it a step further and see if I can get it to 5th normal form so that I can understand it better as next week we will be doing another group ERD that will have to be in 5nf the thing is I don't know where to start and the book is not getting through to me. can you guys help me.Erd Model http://img534.imageshack.us/img534/2118/capturekk.jpg

New information "Fake Clients Needs"

The client has 2 departments "Lab 1, Lab 2" that order medical items from him, like gloves and pi pets etc.. the departments have grown and he wants to keep track of what is in inventory what the vendors are selling who has the best price and what cost center it came from.

The way he explained it the item is ordered is that an individual goes to him and asks for supplies he then writes down what lab the person is from the persons name and what cost center to bill. but he also wants to track what has been purchased by date and what is in stock and what has to be bought. He also gave an example that some users want items from a specific vendor that might not have the best prices and he also receives some catalogs in the mails with prices too that he wants to track.

I apologize if its jumbled but this is all from memory.

4

2 回答 2

4

我要直截了当地说,您当前的架构实际上没有任何资格获得 5NF。引用维基百科的话,它说大多数 4NF 表已经符合 5NF:

用法 仅在极少数情况下,4NF 表不符合 5NF。在这些情况下,控制 4NF 表中属性值的有效组合的复杂现实约束并不隐含在该表的结构中。如果这样的表没有被规范化到 5NF,那么维护表内数据的逻辑一致性的负担必须部分由负责对其插入、删除和更新的应用程序来承担;并且表中的数据将变得不一致的风险增加。相比之下,5NF 设计排除了这种不一致的可能性。

http://en.wikipedia.org/wiki/Fifth_normal_form

也许目的不是让您的数据库成为 5NF,而是了解它与 5NF 相比的结构,并就为什么它可能已经在 5NF 中提出论据。

更新:从评论中阅读某种形式的共识,似乎您的设计可能已经在 5NF 中,无论是设计使然还是之前的规范化过程中的意外。

于 2010-08-05T15:45:48.940 回答
1

免责声明:在不了解您的业务逻辑的情况下,我可能对以下一些建议完全错误。

好的,我在您的数据库架构中看到了一些东西。

  1. 您的成本中心表看起来既是查找表又是关联表。因此,如果您有一定数量的成本中心,比如说 5 个,但有 1000 个用户,那么该表将有 5000 条记录,它们都存储成本中心名称(这是假设成本中心分配对每个用户来说不是唯一的)。您可能希望将用户关联拆分为一个单独的表,该表具有自己的成本中心 ID 和用户 ID 的 PK 和 FK。
  2. 您的库存表,我假设存储一个项目的现有库存数量,应该只需要一个现有数量,不确定描述是什么。如果描述不是每个项目库存的唯一描述,您可能希望将其拆分为它自己的查找表并在库存表中引用它。
  3. 您将“lineQuantity”存储在供应商表中。这个专栏是干什么的。听起来它以某种方式与特定订单相关(购买的商品数量?)如果是这样,您将希望将其拆分为自己的表格并将其与订单而不是供应商相关联。尽管这个建议可能完全错误,但不知道 lineQuantity 到底是什么。
  4. 最后一个建议不确定这对您的班级是否重要。您将所有数据类型定义为 CHAR(10),您可能希望将这些数据类型更改为您将用于数据库的实际数据类型。
于 2010-08-05T16:41:49.840 回答