Cities and counties data sources Google Maps. (including 34 provinces, 371 municipalities, 2,824 County districts)
Copy Code code as follows:
/********** Create provincial table **********/
CREATE TABLE t_province
(
Proid INT IDENTITY (1,1) PRIMARY key,--province primary key
Proname NVARCHAR not NULL,--province name
ProSORT INT,--provincial sort
Proremark NVARCHAR (50)--Description
)
Go
Copy Code code as follows:
/******** create a city-level table ********/
CREATE TABLE t_city
(
Cityid INT IDENTITY (1,1) Primary key,--City primary key
CityName NVARCHAR not NULL,--City name
Proid INT,--affiliation province
Citysort INT--City sort
)
Copy Code code as follows:
/********* City County District table *********/
CREATE TABLE t_district
(
Id INT IDENTITY (1,1) PRIMARY KEY,
Disname NVARCHAR not NULL,--county name
Cityid INT not NULL,--owned city
Dissort INT--sorting of counties
)
Data Download Address: Allcitydata