如何绘制带有基数的 ERD?
如何绘制带有基数的 ERD? 我还在上学,我不知道该怎么做。 我只需要一个示例想法谢谢
how do I draw a ERD with cardinality? I am still in school and I am not sure how to go about it. I just need a sample idea Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
取决于您使用的符号。 我发现将诸如“0..*”或“m”或“1”之类的内容放在关系链接的一端,靠近它所适用的表,以表示“零个或多个”或“m”或“恰好1” required”很好地传达了我的意图。
Depends on the notation you're using. I find that putting something like "0..*" or "m" or "1" at one end of the relationship link, near the table it applies to, to denote "zero or more" or "m" or "exactly 1 required" communicates my intent pretty well.
一般来说,我喜欢使用 MS Visio(如果您是学生,您应该可以在 Dreamspark
请务必考虑 ERD 中的实例而不是类(即,实体将被称为学生,而不是学生),
因为它们没有逻辑意义,而是使用关联实体。 ="http://www.wisegeek.com/what-are-associative-entities.htm" rel="nofollow">参见此处)。
开始时仅显示最大基数 学生有多个成绩且成绩所属一名学生:
然后进入最小基数 学生不必有成绩,因此学生有 0-多个成绩,但一个成绩必须属于一个学生,因此一个成绩有 1 并且只有 1 个学生
要阅读上面的示例,请从第一个实体,并确定该实体是(学生),并且该关系将其连接到(年级)。查看您从(学生)开始的相反一侧的基数标记。
0<
。 最接近成绩的是最大基数,或者学生可以拥有的最高(成绩)。<
表示一个(学生)可以有多个(年级)。0
是最小基数,它告诉我们是否需要这种关系。 在本例中,它是0
而不是|
,因此不需要Generally I like to use MS Visio(if you're a student you should be able to get it for free at Dreamspark.
Be sure to think about INSTANCE in ERD's instead of classes (I.E. an entity would be called Student, NOT Students).
Avoid many-to-many relationships as they don't make logical sense. instead use associative entities (See here).
Start with only displaying maximum cardinality Student has many Grade and grades belong to one student:
Then get into Minimum cardinality Students don't have to have grades so Students have 0-Many Grades, but a grade MUST belong to a student so a Grade has 1 and only 1 Student
To read the above example you begin at the first entity, and identify the relationship. The entity is (student) and the relationship connects it to (Grade). Look at the cardinality markings on the OPPOSITE side that you started from. Since we started at (Student) we're looking at
0<
. Closest to grade is the MAXIMUM CARDINALITY, or the most (Grade)'s that a student can have. the<
means a (Student) can have many (Grade)'s. The0
is the Minimum CARDINALITY, and it tells us whether or not the relationship is required. in this case it's a0
and not a|
so it's not required