[thelist] Zip Code mysql db

J. Scott Johnson scott at fuzzygroup.com
Sun Apr 14 06:22:00 CDT 2002


I'm not certain exactly what you are asking here.  But I did a quick google
search and I found a supposedly FTP'able resource here:

You can also download a City-State-ZIP table from
ftp://ftp.census.gov/pub/tiger/tms/gazetteer/ . It contains the Lat/Long
coords for each ZIP too.

What do you need exactly and what language are you working in?

Scott

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Russell Griechen
Sent: Sunday, April 14, 2002 2:26 AM
To: thelist at lists.evolt.org
Subject: [thelist] Zip Code mysql db


I need to search for the nearest entity in range of 100?? miles.
I have a mysqldump...city table does not have a zip_code field or
zip_code_id
I would prefer to enter in zip_code either/or by memory or by data
input...maybe a zip+4 or foreign. In some tables (city for instance)I
would want to use zip_code_id and others I would use zip_code and use
info supplied by others or entered by others.
is there an option to use:

CREATE TABLE zip_code (
   zip_code varchar (15)
PRIMARY KEY (zip_code)
and would this serve as lookup table?
Any other comments appreciated
I realize I would have to alter the city table shown below.
#
# Table structure for table 'city, country, state'
#
CREATE TABLE city (
   city_id mediumint(9) DEFAULT '0' NOT NULL auto_increment,
   name varchar(75) NOT NULL,
   latitude float(7,5) DEFAULT '0.00000' NOT NULL,
   longitude float(7,5) DEFAULT '0.00000' NOT NULL,
   state_id tinyint(4) DEFAULT '0' NOT NULL,
   PRIMARY KEY (city_id),
   KEY name (name),
   KEY latitude (latitude),
   KEY longitude (longitude),
   KEY state_id (state_id)

CREATE TABLE state (
   state_id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
   abbrev char(2) NOT NULL,
   name varchar(30) NOT NULL,
   country_id char(2) NOT NULL,
   PRIMARY KEY (state_id),
   KEY country_id (country_id),
   KEY name (name),
   KEY abbrev (abbrev)CREATE TABLE country (
   country_id char(2) NOT NULL,
   name varchar(50) NOT NULL,
   PRIMARY KEY (country_id),
   KEY name (name)

Russell Griechen

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list