I\'m new to SQL and relational databases and I have what I would imagine is a common problem.
I\'m making a website and when each user submits a post they have to pr
I got that beat. Here's a free one (zipped, csv):
Hosted At maphacks.com
Headers are zip,city,state,latitude,longitude,timezone,dst
Now, your potential loss is that you aren't paying for updates (which can bite you in the end, but they try to keep it somewhat updated)
There are many free geo-coding webservices where you can get a zip from a city-state, and vice-versa. Take a look at the GeoNames webservice. You could do something like check your db, and then if what you are looking for is not there, grab it from the webservice and add it.
Not sure I understand the question. Do you need to allow either and, later, return both?
You'll have to be careful, even with a zip/city database that can be purchased, since some cities span multiple zips, so you can't always "calculate" in that direction. Similar issue in the opposite direction.
I would like to add this website.
http://www.unitedstateszipcodes.org/zip-code-database/
You can download the data for free if you use for Personal/Educational (as of 2014-03-20).
My understanding is that the USPS web API is free to use, but requires permission that depends on a number of factors, including the nature of the program that will be using it and the reason you need the data.
If you qualify to use it, this would presumably be the most accurate source for the information you need.