Popgun Posted August 10, 2008 Share Posted August 10, 2008 Sorry could not find a specific thread on this, setting up a user database, while normalizing noted that Zip Codes in US will require its own table. Does this structure look right? TABLE zip ( zip_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, zip VARCHAR(10) NOT NULL, PRIMARY KEY (zip_ID)); This is then linked to: TABLE locations ( location_ID INT UNSIGNED Not NULL AUTO_INCREMENT, zip_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, city ENUM NOT NULL, state ENUM NOT NULL, country ENUM NOT NULL, PRIMARY KEY (location_ID)) Thoughts/Suggestions? Quote Link to comment Share on other sites More sharing options...
Barand Posted August 10, 2008 Share Posted August 10, 2008 As it is, that's a normalization too far. However, were you to store other data related to zip code (such as latitude, longitude etc) then you would have a separate table, but just use the zip itself as the PK. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted August 10, 2008 Share Posted August 10, 2008 I would download this: http://www.populardata.com/downloads.html - txt file format. I have it in SQL format, so if you want I could give you the SQL... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.