2 relationships between 2 entities in ER diagram
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
Hi mate watch this diagram, hope it helps
Solution 3
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.
user1330217
Updated on September 18, 2020Comments
-
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 over 11 yearsThis 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 over 11 yearscheck out my other answer below
-
Nikunj Madhogaria over 8 yearsThis solution is acceptable only if a
Department
can have multipleEmployee
as managers. -
Nikunj Madhogaria over 8 yearsYour first linking table is not required. The
DepartmentID
inDepartmentEmploys
can simply be a FK in theEmployee
table. Also, the second linking table is acceptable only if aDepartment
can have multipleEmployee
as managers. -
el-aasi almost 5 yearshey what software are you using for making the diagrams?
-
Nick almost 5 years@el-aasi I'm using Sql Management Studio. Watch this youtube.com/watch?v=wMbPRHeYvMU