简体   繁体   中英

How can i get this constraint in a ER Diagram?

How can I get the third rule (the bold one) in an ER:

  • A Teacher can help many Students and a Student gets help from many Teachers.
  • A Teacher can lead many Students but a Student can be led by only one Teacher.
  • The Teacher can't help the Student whose he is leading ."

在此处输入图片说明

Maybe something like this: 在此处输入图片说明

You need do add a constraint between your Help and Lead tables. Make sure the TeacherId - StudentID couple (?) are not in both tables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM