Saturday, February 25, 2012

Database design question

I have a database that allows a client to have many addresses some are examples would be Home, Office, Vacation Home, etc... If we are mailing to a home address we would not want to the company name or title fields to be included, oh yah all files are exported to Excel for merging. I would like to put the company name and title fields in the address table so if we are mailing to a business or office the company name and title go with it, and if it is an address other than a business or office the company name and title are blank.

Does this really break any kind of rules, if we look at it as I have stated here?

Thanks for any thoughts,Yes. It is definitely breaking rules, the rules or normalization, and my guess is that you realize this or you would not be asking this question.

And sooner or later, making a bad design choice like this will come back to haunt you.

Have an Address table, and a Person table, and a Company table, and a PersonType table, and set the attributes accordningly. The query to get the data will be a bit more complex, but you'll reap the benefits of increased data integrity for a long time...|||So if I have a design like the following, how would you suggest that I exclude the companyName and ClientTitle if I'm mailing to a home address and the client has a home and company address in the address table? Thanks for your thoughts again.

tblClients
ClientID
ClientType = Indivudal or Company, etc...
CompanyName
ClientTitle

tblAddresses
AddressID
ClientID

tblClientTypeLookup = Individual, Company, etc...

No comments:

Post a Comment