Thread: zip code DB?
View Single Post
Old 04-25-2008, 07:40 PM  
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
They updated in Jan '08. I figured I might as well get a new import. This is a really bad DB schema, but it was mostly just to get it out of CSV. Enjoy.

Code:
CREATE TABLE `zipCityData` (
  `localid` int(10) NOT NULL auto_increment,
  `zip` varchar(5) NOT NULL,
  `city` varchar(64) NOT NULL,
  `state` varchar(2) NOT NULL,
  PRIMARY KEY  (`localid`),
  KEY `zip` (`zip`)
) TYPE=INNODB  AUTO_INCREMENT=41755;
localid is just for a numeric index so you have a non-zipcode key. Since this is probably going into MySQL of an unknown version (3.2.23 to 5.x), I decided to ensure it wouldn't corrupt the numbers by making them varchar. Whatever you wanna do with it, it's yours.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote