阅读量: 138
以下为代码为省市区的表内容结构
# 创建省信息表
create table if not exists table_china_province (
id int auto_increment comment '主键' primary key,
province_id int(10) not null comment '省id',
province_name varchar(50) default '' not null comment '省名称',
constraint province_index unique (province_name) comment '省信息索引'
) comment '省信息表' char set utf8;
# 创建市区信息表
create table if not exists table_china_city
(
id int auto_increment comment '主键' primary key,
city_id int(10) not null comment '城市id',
city_name varchar(50) not null comment '城市名称',
province_id int(10) not null comment '省id',
constraint city_index unique (city_id, city_name, province_id) comment '城市信息索引'
) comment '城市信息表' char set utf8;
# 创建区县信息表
create table if not exists table_china_area
(
id int auto_increment comment '主键' primary key,
area_id int(10) not null comment '区县id',
area_name varchar(50) not null comment '区县名称',
city_id int(10) not null comment '城市id',
constraint area_index unique (area_id, area_name, city_id) comment '区县信息索引'
) comment '区县信息表' char set utf8;
以下为省市区sql代码,由于数据过大,请下载查看