I am a little confused about how to create the proper relationships between
my tables. I have four tables, Patient information, veterinary information,
tumor information, follow-up information. I am inputing data about a study
done on canine mammary cancer. There is only one patient per veterinarian,
so I would want to create a one-to-one relationship with each table. Every
table has the same primary key - Patient ID. Is this ok? How should I create
the relationship between tables?
Thanks!
No. It is certainly not OK!
Each Table should represent instances of one type of Entity. A patient
is one type of entity; a veterinarian is a very different type of
entity. I would suggest that you should NOT use one to one
relationships; maybe right now you don't have one vet with two dogs
under study, but it would be a bit foolish to design the database to
make entry of such a case impossible!
I'd suggest
Veterinarians
VetID Autonumber Primary Key
LastName
FirstName
<other contact information>
Patients
PatientID Primary Key (do you have written study numbers? the
Primary Key should be unique and preferably numeric, but if it's going
to be used by people it may be best NOT to use an autonumber)
<information about the dog, e.g. name, owner, breed, ...>
VetID Long Integer <link to Veterinarians, many side of a one to
many>
You may want to simply keep tumor information in fields in the
Patients table, assuming that each dog only has one condition being
treated; or if an animal might have multiple tumors, you would have a
separate Tumors table:
Tumors
TumorID Primary Key Autonumber
PatientID <link to Patients, many side of a one to many link>
Treatments? I don't know; does each dog get one and only one
treatment, end of story? or might there be multiple treatments over
time?
As for followups, surely there are multiple assessments over time to
see how well the animal is responding to treatment - if so, there's
another one to many!
John W. Vinson[MVP]