实体关系建模,评论我的ERD

发布于 2025-01-05 02:35:56 字数 610 浏览 4 评论 0 原文

注意:由于声誉较低,我无法发布图像,因此我相应地添加了链接。

我正在执行这项任务,并且陷入了递归关系,以下是我当前正在建模的案例场景的一部分;

现在,从前三段中我推导出以下业务规则;

  1. 员工被分配到一个分公司,一个分公司雇用一名或多名员工
  2. 每个分公司指定一名经理和一名助理经理
  3. 员工由一名经理管理,并由一名助理经理监督
  4. 员工提交零份、一份或多份以前的雇佣记录,记录仅与一名员工相关联
  5. 员工仅被分配一个工作职位,一个工作职位可以分配给一名或多名员工

(注意:我在规则 n.2 中假设分支机构也被指定为一名助理) manager)

现在这是上述规则的 ERD 图;

所以从场景来看,助理经理只是监督员工,但并没有说与分公司有任何关系实体,但是我认为分支应该与经理和助理经理有关系,但我有点困惑,所以我还没有将其添加到 erd 图中。你们能帮我一下吗?

Note: Due to low reputation I can't post images so i have added the links accordingly.

I have this assignment I'm working and I am stuck in a recursive relationship, following is part of the case scenario that I am currently modelling;

Now, from the first Three paragraphs i have deducted the following business rules;

  1. Employee is allocated ONE branch and a branch employs ONE or MANY employees
  2. Each branch is designated ONE manager and ONE assistant manager
  3. Employee is managed by ONE manager and supervised by ONE assistant manager
  4. Employee submits ZERO, ONE or MANY previous employment records, a instance of a record is associated to ONE employee only
  5. Employee is assigned ONE job position only, a job position can be assigned to ONE or MANY employees

(note: I have assumed in rule n.2 that a branch is also designated an assistant manager)

And now this is the ERD diagram for the above rules;

So from the scenario, the assistant manager only supervises the staff, but it does not say that it has any relationship with the branch entity, however i assumed that a branch should have a relationship with the the manager and the assistant manager, but i am a bit confused so i havent added it yet to the erd diagram. Can you guys help me out?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

七婞 2025-01-12 02:35:56

首先,您似乎正在绘制 UML 域模型而不是 ER 图。这些不是同一件事。您已经确定了一名员工,但似乎试图以多种方式使用它来处理所有事情。当您应该遵循实体关系规范化的规则时,这种过早的优化(以及重用)。退一步,为经理、助理经理和员工创建表。将字段添加到其中,然后尝试标准化。

Firstly it appears you seem to be drawing a UML Domain model not a ER diagram. These are not the same thing. You've identified an employee but seem to be trying to use it polymophically for all things. This premature optimisation (and for re-use), when you should be following the rules of normalisation of entity relationships. Take a step back, create tables for manager, assistent manager and employee. Add the fields to those, THEN try to normalise.

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