Jump to content

DB Design: ZIp Codes


Popgun

Recommended Posts

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?

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/118987-db-design-zip-codes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.