Database schema query - Phone number capturing

  • Hi,
    I have been tasked with creating a schema to store phone numbers. 

    I've have looked through the various previous posts for guidance and the end result is below.
    The main difference for us is that we capture Phone numbers in relation to different entities (customers, sales, patients, buyers, sellers,staff, Companies etc) .

    To this end I created three tables Phone_Category ,Phone Numbers and Phone_link_tbl .

    My question is ,is it better to have for example the staff_id,contact_id,company_id etc. stored in the Phone_link_tbl orto have a separate table for staff, companies and contacts each .

    Thanks for the help !

  • If you already have separate tables for staff, contacts, and companies, then it probably makes logical sense to stay consistent and have 3 separate link tables.  While it is possible to have 1 link table with the 3 different foreign keys, you'd probably also want a check constraint then to enforce that only 1 of the 3 foreign key columns is populated for each row.  It would probably also be more confusing writing those joins with a single link table.

  • Thank you very much !

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply