MySQL Forums
Forum List  »  Newbie

Re: Portal Database design help
Posted by: Rick James
Date: April 30, 2009 11:12PM

Yes and no.
You have moved toward "normalization", which is (usually) good.

However, I wanted you to change the phone number from columns to rows:
Instead of:
contact_numbers table
company_id | phone1 | phone2 | mobile1 | mobile2 | fax1 | fax2

contact_numbers table
company_id | type_of_number | number

A small company with just one phone would have 1 row; a huge company might have 6, or even more, rows.

Another approach (assuming you never need to search on numbers):
contact_numbers table
company_id | numbers
where 'number' is a string looking like (say):
"phones: 321-432-2300, 321-432-2301; fax: 321-432-2399"
In other words, human readable, but otherwise an arbitrarily formatted string.

Any of the above will "work". You will find out later which works best in your situation.

Options: ReplyQuote


Subject
Written By
Posted
April 27, 2009 12:12AM
Re: Portal Database design help
April 30, 2009 11:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.