zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

最新的省市区三级地区 MySQL 表数据

2023-04-18 16:15:38 时间

阅读量: 133

以下为代码为省市区的表内容结构

# 创建省信息表

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代码,由于数据过大,请下载查看

info下载