Relational Database emergency person + contact number?

I'm trying to design a normalized relational database where a patient has a *contact person* (person who is contacted in case of emergency). I also have a table called contact_num which takes patient_id as a foreign key. But how can I implement having a emergency contact person (who has a phone number) who may/may not be another patient? Should I implement emergency_contact_num table? Or some kind of unary relationship? egs would be helpful

Answers


I think you could have a contacts book, all stored in a database

So for the patient, the entry into the database could be:

'id' => '1' 'first_name' => 'john' 'last_name' => 'doe' 'emergency_contact' => '2'

Of course, you should also include any important information about this person in this table (ex. Phone number). For the emergency contact, the database could be:

'id' => '2' 'first_name' => 'lisa' 'last_name' => 'joe' 'emergency_contact' => 'none'


If your goal is normalization, then contact information is contact information regardless of what role the person plays in the operation. Go with the contact book suggestions, but don't include emergency contact, etc. A patient is a patient, and could have any number of details required that have nothing to do with contact information. At that point, you can either include emergency contact information as part of the primary patient table or, if you expect the possibility of multiple contacts for single patient, you could have a patient_Contact table that would contain the patient id from the patients table and the contact id for each contact listed. This would provide the maximum flexibility for contacts having multiple relations with different actors in the process simply by storing the cross reference.

So rather than including a patient as FK on the contact, include the contact id on the patient. you could also at that point include the patient contact data (their phone number, address, etc) on the contact table, and reference the contact id as PatientContact. now you only have one table storing Name, phone number, address, etc.


Need Your Help

Which data structure to store tables and field names?

c# .net sql-server data-structures dictionary

I am retrieving tables and their respective fields from a database, and would like to store them within my C# application.

Header View title getting overwritten with Inherited controller

iphone uitableview uinavigationbar subclassing qheaderview

I am trying to access the properties and objects that are declared in one view controller in to the page where I need them.Did so by subclassing the view controller.But I have got a problem here,th...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.