Provincial/Municipal/district/county Data source: Google map (including 34 provinces, 371 cities, and 2824 counties)
Copy codeThe Code is as follows:
/*********** Create a provincial table **********/
Create table T_Province
(
ProID int identity (1, 1) primary key, -- province PRIMARY KEY
ProName NVARCHAR (50) not null, -- province name
ProSort INT, -- sort by province
ProRemark NVARCHAR (50) -- Description
)
Go
Copy codeThe Code is as follows:
/******** Create a municipal table ********/
Create table T_City
(
CityID int identity (1, 1) Primary KEY, -- City Primary KEY
CityName NVARCHAR (50) not null, -- city name
ProID INT, -- Province
CitySort INT -- city sorting
)
Copy codeThe Code is as follows:
*********/
Create table T_District
(
Id int identity (1, 1) primary key,
DisName NVARCHAR (30) not null, -- district/county name
CityID int not null, -- City
DisSort INT -- sort by district/county
)
Data: AllCityData