Zip Code to City/State and vice-versa in a database?

后端 未结 11 847
无人共我
无人共我 2020-12-28 11:20

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

11条回答
  •  自闭症患者
    2020-12-28 11:29

    Have a ZipCode table that is related to a CityState table. Some zip codes have multiple cities associated with them, so you may need to have the interface let the user select from the city they want or let them override the default.

    I use the paid service from ZipInfo.com since I needed additional information such as lat/long, zip type and county. Zip codes also change several times as year as new zip codes are added or merged with others, so you will need to update your data a few times a year to stay consistent.

提交回复
热议问题