var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Question at beginners-level from a Delphi-programmer.
I need to log people's medicine usage and
now I'm stuck with my database-design.
This is the situation :
There is a many- to many relationship
between Table.Day and Table.Medicine.
Table.Medicine is a list of medicine names
Now, in this design there is only one list
for all users, but I need a unique
list of medicine for each and every user.
How can I best do this?
Thanks in advance.
Re: Beginning db-design
You want a many-to-many relationship between USER and MEDICINE tables. This is done by creating a third "intersection" table, perhaps named USER_MEDICINE, that has the structure:
USER_MEDICINE( UserID, MedID, ... )
PRIMARY KEY( UserID, MedID )
FOREIGN KEY( UserID ) REFERENCES User
FOREIGN KEY( MedID ) REFERENCES Medicine
Other columns in this table (if any) would relate to the particular user and medicince, e.g. dosage, from_date, to_date, prescribed_by, etc.