If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Entity Relationships

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-09-10, 19:26
GreenChai GreenChai is offline
Registered User
 
Join Date: Sep 2010
Posts: 3
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?
Reply With Quote
  #2 (permalink)  
Old 09-10-10, 07:47
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
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
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #3 (permalink)  
Old 09-10-10, 12:05
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
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.
Reply With Quote
  #4 (permalink)  
Old 09-10-10, 20:39
GreenChai GreenChai is offline
Registered User
 
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!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On