将 EER 图/生成的架构转换为 ER 图
我正在开展一个学校项目,该项目需要创建 ER 图和从该图派生的数据库架构。该模式有一些非常严格的大小要求(不超过 x 个表)。我遇到了一个问题,我的一些实体遵循“is-a”类型的关系,这种关系最好使用 EER 模型来描述,但我们不允许使用这种关系。这是我想要实现的目标的一个非常粗略的轮廓:
我需要跟踪几个具有许多(完全独特的属性)的独特[零件]。它们都有一些共同的属性,例如(QuantityInStock)。我的[机器]使用任何(数量)任何这些不同的[部件]。
如果我遵循 ER 模型,我相信机器将与每个独特的零件类型具有单独的 M 对 N 关系。每个 M 到 N 的关系都应该转换成它自己的表。由于我们有严格的最大餐桌数量限制,这是不可能的。
如果我遵循 EER 模型,则转换过程只会生成一两个额外的表 - 每个 [Part] 不再有一个关系。
我需要完成的是以某种方式将“is-a”关系(即 [ThisPartType]“is-a”[Part])转换为在 ER 模型中工作的东西。我需要某种方法将不同的独特部件与使用这些部件的机器联系起来。
举一个我想要的例子:
- 机器 A 使用 30 个 PartA[1]、47 个 PartB[21]、22 个 PartC[18] 和 3 个 PartD[54]。
- 机器 B 使用 PartC[12] 的 8 个和 PartD[44] 的 1 个。
- 机器 C 使用 PartF[0] 的 1 和 PartZ[28] 的 5。
我希望能够访问 PartB[21](半径、螺纹宽度)的独特信息,并查询所有 PartC 中最重的部分。但我还需要能够以不需要更多表格的方式将这些部件分配给机器。
I'm working on a school project that requires the creation of an ER diagram and a database schema that is derived from that diagram. The schema has some very stringent size requirements (no more than x number of tables). I'm running into an issue where some of my entities follow an "is-a" type relationship that is best described using the EER model, something we aren't allowed to use. Here's a very rough outline of what I'm trying to achieve:
I need to keep track of several unique [Part]s that have many (entirely unique attributes). They all share some attributes, like (QuantityInStock). I have [Machine]s that use any (quantity) of any of those different [Part]s.
If I follow the ER model, I believe the machines will have a separate M-to-N relationship with each unique part type. Each M-to-N relationship is supposed to translate into its own table. Because of the strict maximum number of tables we are allowed to have, this isn't possible.
If I follow the EER model, the translation process generates only one or two extra tables - not one more relation for each [Part].
What I need to accomplish is somehow convert the "is-a" relationship (i.e. [ThisPartType] "is-a" [Part]) into something that works within the ER model. I need some way to relate of the different unique parts to the machines that use those parts.
To give an example of what I'm going for:
- Machine A uses 30 of PartA[1], 47 of PartB[21], 22 of PartC[18], and 3 of PartD[54].
- Machine B uses 8 of PartC[12] and 1 of PartD[44].
- Machine C uses 1 of PartF[0] and 5 of PartZ[28].
I'd like to have access to the unique bits of information for PartB[21] (radius, threadwidth), as well query the heaviest of all the PartCs. But I also need to have the ability to assign these parts to the Machines in a way that doesn't need many more tables.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论