[eluser]alexmiller[/eluser]
Hi all
I am at the planning stage of a project and want to get my head around the way to structure a specific part of the database.
The database will store a number of tables, but for the purpose of this question I'll simplify it down. I want a table called
businesses and a table called
users. Both users and businessess can have multiple telephone numbers (eg. mobile, landline, fax). I want to store the telephone numbers in a separate table to prevent repitition, and to allow multiple numbers for each business.
So, here is my problem. Should I create the
telephones table as follows:
Code:
owner_id : the ID of the owner (eg. business_id or user_id)
owner_table : the name of the owners table (eg. businesses or users)
telephone_number : obvious really
telephone_type : eg. fax, landline etc.
This seems to make sense to me, but can anyone see a problem with this? Can anyone suggest what this might be called so that I can have a read up on Google. I also want to use the same structure for addresses.
Kind regards
Alex