Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase normalization question
    text
    copied!<p>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.</p> <p><strong>Customers Table</strong></p> <pre><code>ID | Date_Entered | First_Name | Middle_Name | Last_Name | Maiden_Name </code></pre> <p>...</p> <pre><code>Address__street_dmv | Address_city_dmv | Address_state_dmv | Address_zip_dmv </code></pre> <p>... </p> <pre><code>Address__street_source2 | Address_state_source2 | Address_city_source2 | etc </code></pre> <p>.</p> <p>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.</p> <p>.</p> <p><strong>Addresses</strong></p> <pre><code>ID | Number | Street | State | Zip | Source (drop down menu) </code></pre> <p>But then I was thinking the source would be redundant data. So, do I need a separate sources table like this?</p> <p><strong>Sources</strong></p> <pre><code>Source_ID | Source </code></pre> <p>And change the addresses table like this?</p> <pre><code>ID | Number | Street | State | Zip | Source _ID (drop down) </code></pre> <p>It doesn’t seem right because now the Source_ID is redundant… Please help.</p> <p>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?)</p> <p>Sorry for being a noob.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload