注意:由于声誉较低,我无法发布图像,因此我相应地添加了链接。
我正在执行这项任务,并且陷入了递归关系,以下是我当前正在建模的案例场景的一部分;

现在,从前三段中我推导出以下业务规则;
- 员工被分配到一个分公司,一个分公司雇用一名或多名员工
- 每个分公司指定一名经理和一名助理经理
- 员工由一名经理管理,并由一名助理经理监督
- 员工提交零份、一份或多份以前的雇佣记录,记录仅与一名员工相关联
- 员工仅被分配一个工作职位,一个工作职位可以分配给一名或多名员工
(注意:我在规则 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;
- Employee is allocated ONE branch and a branch employs ONE or MANY employees
- Each branch is designated ONE manager and ONE assistant manager
- Employee is managed by ONE manager and supervised by ONE assistant manager
- Employee submits ZERO, ONE or MANY previous employment records, a instance of a record is associated to ONE employee only
- 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?
发布评论
评论(1)
首先,您似乎正在绘制 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.