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 > General > Database Concepts & Design > How to design Phone Entity to associate to multiple other entities

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-05-09, 11:52
mamorgan1 mamorgan1 is offline
Registered User
 
Join Date: May 2009
Posts: 2
Question How to design Phone Entity to associate to multiple other entities

Good morning everyone,

I hope you can help me with this design question. I am designing a database to track patients, physicians, and contacts. I would like to capture multiple phone numbers for each of these entities. In the current database we use GUID's to manage relationships between Phone and each of the other entities (Physician, Contact, Patient). I would like to get away from GUID's as they seem to cause more trouble than they are worth. Currently there are no constraints on these relationships between GUID columns.

Due to the use of GUID's there was never an issue with a Contact having the same ID as a Patient. In the new design I am considering using and Identity column of data type int. This will require that I keep track of a PhoneOwnerType (Patient, Physician, or Contact) so that I can differentiate from Contact ID 134 and Patient ID 134.

Obviously this adds columns and a table. I'm at a loss as to which is a better design. The GUID approach is simpler with less tables and columns, but I feel like I have run into issues when I have said...darn it...I wish this weren't a GUID column.

Any thoughts on this design or another better design for capturing multiple Phone numbers for multiple entities?

Thanks

mamorgan1
Reply With Quote
  #2 (permalink)  
Old 05-05-09, 14:40
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
I'd load all contacts/patients/physicians/etc into a single table (which I usually call "Entities"). I'll then have a column in that table to indicate the type of Entity, or better yet have a subtable to hold Entity types, as who is to say that a physician can't also be a patient?
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #3 (permalink)  
Old 05-05-09, 18:20
mamorgan1 mamorgan1 is offline
Registered User
 
Join Date: May 2009
Posts: 2
Blindman, can I assume you prefer the use of Identity (int) to the GUID in this situation?

What are the negatives of a super entity/sub entity design?
Reply With Quote
  #4 (permalink)  
Old 05-06-09, 10:42
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
You can use an Identity or a GUID, and that decision depends on other factors.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
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