I just started learning about database normalization and I have a question about one of my tables. My database right now is structured horribly, and one of the reasons is because I have a table that looks like this.
Customers Table
ID | Date_Entered | First_Name | Middle_Name | Last_Name | Maiden_Name
…
Address__street_dmv | Address_city_dmv | Address_state_dmv | Address_zip_dmv
…
Address__street_source2 | Address_state_source2 | Address_city_source2 | etc
.
The addresses keeping going on and on because my company obtains address data from multiple sources. But, of course, some of these address will be Null for some of our customers. So I think I need a separate addresses table like this that connects to the Customers table.
.
Addresses
ID | Number | Street | State | Zip | Source (drop down menu)
But then I was thinking the source would be redundant data. So, do I need a separate sources table like this?
Sources
Source_ID | Source
And change the addresses table like this?
ID | Number | Street | State | Zip | Source _ID (drop down)
It doesn’t seem right because now the Source_ID is redundant… Please help.
Bonus points if you can tell me whether or not I should include Maiden and Middle names in the Customer table since these too could possibly be Null (If not, how would the new table be structured?)
Sorry for being a noob.
I would go with something like
Customer
Addresses
Customers_Address
This allows you to have same address from multiple sources. You might also want to have separate table for streets, possibly like
and then in the
Addressestable you would only haveStreet_IDinstead of bothStreetandState_ID. This also allows you to show a selection list of streets when user has selected state.I’d say it is OK to have Maiden and Middle names in the Customer table, even if they are rarely used.