如何绘制带有基数的 ERD?

发布于 2024-07-22 07:07:43 字数 52 浏览 4 评论 0原文

如何绘制带有基数的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅笑轻吟梦一曲 2024-07-29 07:07:43

取决于您使用的符号。 我发现将诸如“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.

故事和酒 2024-07-29 07:07:43

一般来说,我喜欢使用 MS Visio(如果您是学生,您应该可以在 Dreamspark

请务必考虑 ERD 中的实例而不是类(即,实体将被称为学生,而不是学生),

因为它们没有逻辑意义,而是使用关联实体。 ="http://www.wisegeek.com/what-are-associative-entities.htm" rel="nofollow">参见此处)。

开始时仅显示最大基数 学生有多个成绩且成绩所属一名学生:

(student)|---<(Grade)

然后进入最小基数 学生不必有成绩,因此学生有 0-多个成绩,但一个成绩必须属于一个学生,因此一个成绩有 1 并且只有 1 个学生

 (student)||---0<(Grade)

要阅读上面的示例,请从第一个实体,并确定该实体是(学生),并且该关系将其连接到(年级)。查看您从(学生)开始的相反一侧的基数标记。 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:

(student)|---<(Grade)

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

 (student)||---0<(Grade)

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. The 0 is the Minimum CARDINALITY, and it tells us whether or not the relationship is required. in this case it's a 0 and not a | so it's not required

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文