数据库 – Max Cardinality和Min Cardinality有什么区别?

前端之家收集整理的这篇文章主要介绍了数据库 – Max Cardinality和Min Cardinality有什么区别?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在尝试设计数据库时,我很难理解Max和Min基数之间的区别.

解决方法

记住,基数总是与另一件事的关系.

最大基数(基数)
总是1或许多. A类与包B的关系,基数为1,这意味着包中最多可以有一个此类的出现.相反的可能是一个包的最大心率为N,这意味着可以有N个类

最小基数(可选性)
简单地说就是“必需”.它总是0或1.0表示0或更多,1或更多

有很多好的文章可以解释这一点,包括一些解释甚至属性“diagram”内容.你可以搜索的另一件事是Cardinality / Optionality(OMG Terms)解释同样的事情,Optionality是“Min”Cardinality是“马克斯”,

http://www.databasecentral.info/FAQ.htm开始

Q: I can see how maximum cardinality is used when creating relationships between data tables. However,I don’t see how minimal cardinality applies to database design. What am I missing?

A: You are correct in noticing that maximum cardinality is a more important characteristic of a relationship than minimum cardinality is. All minimum cardinality tells you is the minimum allowed number of rows a table must have in order for the relationship to be meaningful. For example,a basketball TEAM must have at least five PLAYERS,or it is not a basketball team. Thus the minimum cardinality on the PLAYER side is five and the minimum cardinality on the TEAM side is one.

One can argue that a person cannot be a player unless she is on a team,and thus the minimum cardinality of TEAM is mandatory. Similarly an organization cannot be a basketball team unless it has at least five players. The minimum cardinality of PLAYERS is mandatory also. One could argue in the opposite direction too. When a player quits a team,does it cease to be a team until a replacement is recruited? It cannot engage in any games,but does it cease to be a team? This is an example of the fact that each individual situation must be evaluated on its own terms. What is truth in THIS particular instance? The next time a similar situation arises,the decision might be different,due to different circumstances.

原文链接:https://www.f2er.com/mssql/74952.html

猜你在找的MsSQL相关文章