Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2009
    Posts
    4

    Database Design Issue

    Hello Everyone this is my first post.

    I am working through an exercise and I have created the a Normalized Logical Database design (See attached) and ER diagram for a pharmacy system.

    My question is how do you represent a relationship entity with Attributes attached ? In the example I attached I have a Table called Prescribe with Trade_Name, PPSN, GP_Number and Date as PK's and FK's maybe this is wrong from an access design point of view but this is how my Logical databse design worked out.



    Has anyone any suggestions about designing this in access based on the relationships in the ER diagram.

    Hope it makes sense :-)

    Kevin

  2. #2
    Matrix's Avatar
    Matrix is offline Admin
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2005
    Posts
    519
    The ER diagram looks good to me. The tables doesn't seem to have all fields mentioned in the diagram.

  3. #3
    Join Date
    Feb 2009
    Posts
    4
    Thanks for your reply.

    Yeah sorry I forgot to add those columns into the attachment.
    So to link the table and reflect the relationship should is it ok or good design to link two primary key fields ie Drug.Trade_name to Prescribe.Trade_Name ?

  4. #4
    Join Date
    Feb 2009
    Posts
    4
    I also attached a picture Access DB relationships based on the Diagram and Logical databse design. Are hte relationships setup right ? (The relationship between Doctor and Patient is 1 to M but I don't think My Access setup shows that.

    Kevin

  5. #5
    Matrix's Avatar
    Matrix is offline Admin
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2005
    Posts
    519
    Sorry, the table is too small and I didn't look close enough. Don't use name (text field) as PK or FK, always give it an ID field. By this way, you can avoid lots of problems.

  6. #6
    Join Date
    Feb 2009
    Posts
    4
    Is this easier to see.. Its just relationships n Access that I don't think I have right..

  7. #7
    Matrix's Avatar
    Matrix is offline Admin
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2005
    Posts
    519
    I usually will add unique ID (1, 2, 3...) for each table, then use this id to link the tables. e.g.

    The Drug table will be like this:
    id,
    name,
    year_made,
    ....

    In Prescribe:
    id (Optional, maybe the same with PPSN)
    PPSN,
    GP_ID, (or GP_NUM)
    drug_id, (connect to the 'id' in drug table)
    ....

    Hope you get the idea.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Database Design Problem
    By Kurth in forum Access
    Replies: 0
    Last Post: 08-14-2008, 04:09 AM
  2. Issue with conditional imput
    By Estyl in forum Forms
    Replies: 2
    Last Post: 02-19-2008, 10:42 AM
  3. SetFocus Issue
    By Sinjin in forum Access
    Replies: 0
    Last Post: 02-14-2008, 07:31 AM
  4. Need help checking database design
    By abc7 in forum Database Design
    Replies: 1
    Last Post: 10-29-2007, 08:08 AM
  5. Access Issue
    By uk in forum Access
    Replies: 0
    Last Post: 07-04-2007, 09:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums