Home Work & Study
If you need urgent support, call 999 or go to your nearest A&E. To contact our Crisis Messenger (open 24/7) text THEMIX to 85258.

entity relationship diagrams

Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
edited March 27 in Work & Study
can anyone help? i'm doing an ERD for a vet's practise and have a question: can a link entity solve more than one many-to-many relationships? e.g. i have the entities ANIMAL and DRUG. that is many-to-many so i created a link entity called DRUG DISPENSED. there is also a many to many relationship between VET and DRUG. can the DRUG DISPENSED link entity be used for this too? i reckon it can, but just want a bit of assurance! hope someone out there knows what i'm on about :D
Post edited by JustV on

Comments

  • Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Re: entity relationship diagrams
    Originally posted by Natalie
    can anyone help? i'm doing an ERD for a vet's practise and have a question: can a link entity solve more than one many-to-many relationships? e.g. i have the entities ANIMAL and DRUG. that is many-to-many so i created a link entity called DRUG DISPENSED. there is also a many to many relationship between VET and DRUG. can the DRUG DISPENSED link entity be used for this too? i reckon it can, but just want a bit of assurance! hope someone out there knows what i'm on about :D

    :eek2:

    Ask in Anything Goes?
  • Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    cheers for drawing that. that is how i've drawn it out, but i reckon the drug dispensed table would be all i'd need. i could store data about the vet who had given the drug, a drug id, and an animal id. thanks for your help :)
  • Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Easiest is to think about it realistically. You would not have a different drug being dispensed by the vet to what is given to the animal, so why would it be a seperate entity?

    It's also easy to think of in normalised tabular form, because you would only have "vets" "animals" and "drugs".

    In other words the diagram looks right.
Sign In or Register to comment.