Results 1 to 3 of 3

Thread: db-design

  1. #1
    Join Date
    Oct 2002
    Location
    Amsterdam The Netherlands
    Posts
    2

    Unanswered: db-design

    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 :

    Table: User
    UserID
    Username
    ..

    Table: Day
    DayID
    DayMemo
    ..

    Table: MedicineDetail
    MedDetailID
    Dosage
    ..

    Table: Medicine
    MedID
    MedName
    MedUsage
    ..

    There is a many- to many relationship
    between Table.Day and Table.Medicine.
    (using Table.MedicineDetail)

    Table.Medicine is a list of medicine names
    and brands.
    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.

    Mark.

  2. #2
    Join Date
    Oct 2002
    Location
    Rochester, NY
    Posts
    84

    Re: db-design

    Originally posted by Kellemes
    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 :

    Table: User
    UserID
    Username
    ..

    Table: Day
    DayID
    DayMemo
    ..

    Table: MedicineDetail
    MedDetailID
    Dosage
    ..

    Table: Medicine
    MedID
    MedName
    MedUsage
    ..

    There is a many- to many relationship
    between Table.Day and Table.Medicine.
    (using Table.MedicineDetail)

    Table.Medicine is a list of medicine names
    and brands.
    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.

    Mark.
    A suggestion would be to use a cross reference table for users to medicines. This would allow a many to many relationship between your user (IDs) and their medicine (IDs).
    Regards,
    Terry

  3. #3
    Join Date
    Oct 2002
    Location
    Rochester, NY
    Posts
    84

    Re: db-design

    Originally posted by Kellemes
    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 :

    Table: User
    UserID
    Username
    ..

    Table: Day
    DayID
    DayMemo
    ..

    Table: MedicineDetail
    MedDetailID
    Dosage
    ..

    Table: Medicine
    MedID
    MedName
    MedUsage
    ..

    There is a many- to many relationship
    between Table.Day and Table.Medicine.
    (using Table.MedicineDetail)

    Table.Medicine is a list of medicine names
    and brands.
    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.

    Mark.
    Sorry,
    forgot to give a suggestion for the cross reference table - it should look something like this:
    Table: UserMedicines
    UserID
    MedID
    Dosage
    ..


    You may be able to simply add the UserID to the MedicineDetail table, but I'm not sure.
    Regards,
    Terry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •