sql - Relational Database emergency person + contact number? -


i'm trying design normalized relational database patient has *contact person* (person contacted in case of emergency). have table called contact_num takes patient_id foreign key. how can implement having emergency contact person (who has phone number) may/may not patient? should implement emergency_contact_num table? or kind of unary relationship? egs helpful

i think have contacts book, stored in database

so patient, entry database be:

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

of course, should include important information person in table (ex. phone number). emergency contact, database be:

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


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -