2 relationships between 2 entities in ER diagram

44,762

Solution 1

There is no reason you can't have multiple relationships between the same two entities, your understanding is wrong in this respect.

You have to be certain, of course, that the relationships capture different information and that you haven't, say, mistaken the two aspects of a single relationship as two different relationships. Your example seems to be a good candidate for having two relationships between the two entities.

Solution 2

Database Diagram

Hi mate watch this diagram, hope it helps

Solution 3

Diagram Better approach is to add a bit field in Employee table IsManager, so if he is a manager, that means that he is a manager on department he works.

Solution 4

Your relationship for employs and manages are going to be two linking tables. e.g. Consider the tables and fields as below:

Department
   DepartmentID
   DepartmentName

Employee
   EmployeeID
   EmployeeName

SpecialEmployee
   EmployeeID
   Attr1
   Attr2

Now you can go on and link Employee and Department as such:

DepartmentEmploys
     DepartmentEmploysID
     DepartmentID
     EmployeeID


ManagesDepartment
     ManagesDepartmentID    
     EmployeeID
     DepartmentID

Now your relationships do not overlap or interfere. What seems to be drawn in your diagram is correct. There can be more than one relationships between two entities.

Share:
44,762
user1330217
Author by

user1330217

Updated on September 18, 2020

Comments

  • user1330217
    user1330217 over 3 years

    I'm trying to draw an ER diagram describing the following:

    -"Department" employs "Employees"

    -Some "Employees" are "Special" and have more attributes

    -Some of the "Employees" ("Special" and non special) are "Managers"

    -"Managers" manage "Departments"

    So, to convey this I have:

    Department ------(employs)------- Employee-----<--------Special
          |                             |
          |-----------(manages)----------
    

    From my understanding, I cannot have 2 relationships between 2 entities. How do I deal with this situation then?

  • High Performance Mark
    High Performance Mark over 11 years
    This approach doesn't allow for an employee to manage a department unless (s)he is also in that department, and it also allows more than one employee to be a manager in the same department.
  • Nick
    Nick over 11 years
    check out my other answer below
  • Nikunj Madhogaria
    Nikunj Madhogaria over 8 years
    This solution is acceptable only if a Department can have multiple Employee as managers.
  • Nikunj Madhogaria
    Nikunj Madhogaria over 8 years
    Your first linking table is not required. The DepartmentID in DepartmentEmploys can simply be a FK in the Employee table. Also, the second linking table is acceptable only if a Department can have multiple Employee as managers.
  • el-aasi
    el-aasi almost 5 years
    hey what software are you using for making the diagrams?
  • Nick
    Nick almost 5 years
    @el-aasi I'm using Sql Management Studio. Watch this youtube.com/watch?v=wMbPRHeYvMU