Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2010
    Posts
    3

    Unanswered: Entity Relationships

    Basically i have two database tables

    Patient
    Patient Number | Patient Last Name | Patient First Name | Patient Address


    Patient Charges
    Item Description | Item Code | Patient Number | Amount

    How do I make a diagram showing the relationship between the entities Patient and Patient Charges?

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    You will need to look closely at patient and patient charges tables to determine the type of relationship. Can a patient have a charge without being in the patient table? Should a patient have a single charge or can the patient have multiple charges? This will help you in determining the relationship between the tables. When you are talking about a diagram are you talking about UML?
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  3. #3
    Join Date
    Mar 2004
    Posts
    480
    You ideally should have three tables

    patients
    number, lastname, firstname, address

    items
    itemcode, description

    patient_items
    patientnumber, itemcode, amount (is this amount of item i.e. three pills or price?)

    a new row in the third table for each item a patient gets.

  4. #4
    Join Date
    Sep 2010
    Posts
    3
    Quote Originally Posted by guelphdad View Post
    You ideally should have three tables

    patients
    number, lastname, firstname, address

    items
    itemcode, description

    patient_items
    patientnumber, itemcode, amount (is this amount of item i.e. three pills or price?)

    a new row in the third table for each item a patient gets.
    Thanks allot!

Posting Permissions

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