MySQL Forums
Forum List  »  PHP

Re: Help: Table & Data management
Posted by: Peter Brawley
Date: August 10, 2013 03:01PM

Profile" ( ID, ADDRESS_ID, ADDRESS_ID_2, ... )
Table "Address" ( ID, ... )
Table "Company" ( PROFILE_ID, ADDRESS_ID, ... )

Looks like a normalisation problem. Consider something more like ...

countries(ctryID,name,&c)
addresses(addrID,streetaddr,city,state,postalcode,ctrID references countries)
phonetypes(ptID,typename) -- eg home,work,cell &c
phones(phoneID,addrID references addresses,phoneno,ptype references phonetypes)
companies(cpyID,name,&c...)
company_alt_names(cpyID,altname &c)
companies_addresses(cpyiID,addrID)

which allows any company to have any number of names, addresses & phonenos, each of which exists in exactly one place, which is the whole idea, ie to minimise reduncancy.

For more see http://www.artfulsoftware.com/dbdesignbasics.html and http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch01.html.

Options: ReplyQuote


Subject
Written By
Posted
Re: Help: Table & Data management
August 10, 2013 03:01PM


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.