问题
I'm building a web application concerns a student and an adviser. The student will select his independent study and an adviser will supervise it. I am struggling to find the correct relationship for my program.
Basically the actors in my application are.
a Student can select 1 independent study.
a Student can only have 1 Adviser.
an Adviser can supervise multiple Students.
a coordinator can be an adviser also
My attempt to make ERD for my application.
Student - > Adviser (1 to many)
Coordinator - > Adviser (1 to 1)
But the problem is that I need a table that indicates that advisor A supervises student X. How should I do this?
回答1:
Here's another ERD based on ypercube's comments on my other answer:
In this model, if there's an Adviser record with the Coordinator's id as it's id, that Coordinator is an Adviser.
回答2:
Here's an ERD:
My understanding is that a Coordinator is simply an Adviser which supervises another Adviser. If an Adviser's parent_id
is set, that "parent" is the Adviser's Coordinator. My Diagram allows for a Coordinator to supervise more than one Adviser because that what makes sense to me, but that relationship could be changed to One-to-One (1:1)
.
I use MySQL Workbench.
来源:https://stackoverflow.com/questions/8507729/entity-relationship-model-for-student-advisor-application