How design Employee table for many phone numbers? -
let's you're designing employee table , have accommodate different phone numbers.. home, work, , cell suppose there others in future. let's business cares know kind of cell phone each employee uses. how design it?
here's denormalized way. simple, means adding column new phone type:
employee
- employeeid
- employeelastname
- employeefirstname
- employeehomephone
- employeeworkphone
- employeecellphone
- cellphoneid
cellphone
- cellphoneid
- cellphonemake
- cellphonemodel
here's more normalized/extensible way, there's figuring out put cellphone make/model info phone numbers of type = cell (but not type = home or work):
employee
- employeeid
- employeelastname
- employeefirstname
employeephone
- employeephoneid
- employeephonenumber
- phonetypeid
phonetype
- phonetypeid
- phonetypename
- cellphonetypeid <-- that's null non-cell numbers? seems bad design.
my tendency lean toward extensible (though more complex) toward simple (but less extensible), here i'm not sure.. when consider employee never have 1 of each type of phone. if go extensible, future code can't make assumption , have accommodate possibility of multiple numbers of same type (which isn't realistic).
thanks thoughts.
employee
employeeid
employeelastname, employeefirstname
phone
phoneid
phonetypeid, phonenumber
phonetype
phonetypeid
phonemake, phonemodel
employeephone
employeeid, contact
phoneid, notes
where i'd recommend phonetype
dropped altogether. realistically, it's not relevant - , it'll become filled stale garbage. can't see high-power executive going feel need bother informing of details of latest toy. after all, should know automatically, shouldn't they?
i'd add contact
field - look, i'm not on field names, ok? mean reason contact
'work' or 'home' or 'weekends' or 'golf club (thursdays)' or whatever. notes
used - notes, ask jacinta
if contact
'medical emergency' instance.
as having multiple phones - doctor know carries 3 cellphones - that's in addition office phone, practice phone, @ least 2 office-in-hospital phones, public phone-at-home , privae phone-at-home (and multiple homes well...) it's wonder can remember of numbers...
Comments
Post a Comment