A teacher could be an evaluator and also be an evaluatee. How can I achieve this?
2 Answers
You would just add another foreign key to Eval_Result to link to the Evaluatee
So you would have:
Teacher
- T_ID - primary key
- Teacher info - other fields
Eval_Result
- Eval_ID - primary key
- Evaluator_ID - teacher that did the evaluation - foreign key to Teacher
- Evaluatee_ID - teacher being evaluated - foreign key to Teacher
- Results - other fields
Teacher
as evaluator can evaluate multiple Teachers (evaluatees). This is a one-to-many self-referencing relationship.
Evaluator -|--< Evaluatee
Teacher:
id [Primary Key]
name
evaluator [Foreign Key referencing Teacher's id]
evaluation result id [Foreign Key referencing Evaluation Result's id]
Evaluation Result:
id [Primary Key]
result details
A Teacher (evaluatee) can have one evaluation result.
Teacher (evaluatee) -|--|- Evaluation Result