中国地区表设计与数据示例和来源获取

地区表设计

1,地区表数据来源

数据的来源:《国家统计局》官网;
地址:http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/

2,地区表设计

2.1 级联方式

mysql 示例

DROP TABLE IF EXISTS area;

CREATE TABLE IF NOT EXISTS area (
	id bigint not null auto_increment comment 'id',
	code char(20) not null comment '地区编码',
	name varchar(255) character set 'utf8' not null  comment '地区名称',
	pid bigint not null default 0 comment '上级地区id,无上级地区则默认为0',
	PRIMARY KEY (id)
)default charset = utf8 comment '地区表';

#area表的自增id默认从1000开始,之前的编码为国家预留
alter table area AUTO_INCREMENT = 1000;

#插入国家编号时需要指定国家id
INSERT INTO area(id ,code ,name ,pid) VALUES(1 ,'100000000000' ,'中国' ,0);

数据示例:

INSERT INTO area (id ,code ,name ,pid) VALUES (1000,'10000000000','北京市',1);
INSERT INTO area (id ,code ,name ,pid) VALUES (1001,'110100000000','市辖区',1000);
INSERT INTO area (id ,code ,name ,pid) VALUES (1002,'110101000000','东城区',1001);
INSERT INTO area (id ,code ,name ,pid) VALUES (1003,'110101001000','东华门街道办事处',1002);
INSERT INTO area (id ,code ,name ,pid) VALUES (1004,'110101001001','多福巷社区居委会',1003);
INSERT INTO area (id ,code ,name ,pid) VALUES (1009,'110101001002','银闸社区居委会',1003);
INSERT INTO area (id ,code ,name ,pid) VALUES (1014,'110101001005','东厂社区居委会',1003);
INSERT INTO area (id ,code ,name ,pid) VALUES (1019,'110101001006','智德社区居委会',1003);

2018 年完整的插入数据获取:
链接:https://pan.baidu.com/s/1tHE4R5Z1GrgNWuDTQMtN8A
提取码:ss13

2.2 精准数据

mysql示例:

DROP TABLE IF EXISTS `position_village`;
CREATE TABLE `position_village` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `province_code` bigint(20) DEFAULT NULL,
  `province_name` varchar(255) DEFAULT NULL,
  `city_code` bigint(20) DEFAULT NULL,
  `city_name` varchar(255) DEFAULT NULL,
  `county_code` varchar(20) DEFAULT NULL,
  `county_name` varchar(255) DEFAULT NULL,
  `town_code` varchar(20) DEFAULT NULL,
  `town_name` varchar(255) DEFAULT NULL,
  `village_code` varchar(20) DEFAULT NULL,
  `village_name` varchar(255) DEFAULT NULL,
  `city_town_classify_code` varchar(4) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=666936 DEFAULT CHARSET=utf8;

数据示例:

INSERT INTO `position_village` VALUES ('1', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001001', '多福巷社区居委会', '111');
INSERT INTO `position_village` VALUES ('2', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001002', '银闸社区居委会', '111');
INSERT INTO `position_village` VALUES ('3', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001005', '东厂社区居委会', '111');
INSERT INTO `position_village` VALUES ('4', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001006', '智德社区居委会', '111');
INSERT INTO `position_village` VALUES ('5', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001007', '南池子社区居委会', '111');
INSERT INTO `position_village` VALUES ('6', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001008', '黄图岗社区居委会', '111');
INSERT INTO `position_village` VALUES ('7', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001009', '灯市口社区居委会', '111');
INSERT INTO `position_village` VALUES ('8', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001010', '正义路社区居委会', '111');
INSERT INTO `position_village` VALUES ('9', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001011', '甘雨社区居委会', '111');
INSERT INTO `position_village` VALUES ('10', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001013', '台基厂社区居委会', '111');
INSERT INTO `position_village` VALUES ('11', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001014', '韶九社区居委会', '111');
INSERT INTO `position_village` VALUES ('12', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101001000', '东华门街道办事处', '110101001015', '王府井社区居委会', '111');
INSERT INTO `position_village` VALUES ('13', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101002000', '景山街道办事处', '110101002001', '隆福寺社区居委会', '111');
INSERT INTO `position_village` VALUES ('14', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101002000', '景山街道办事处', '110101002002', '吉祥社区居委会', '111');
INSERT INTO `position_village` VALUES ('15', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101002000', '景山街道办事处', '110101002003', '黄化门社区居委会', '111');
INSERT INTO `position_village` VALUES ('16', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101002000', '景山街道办事处', '110101002004', '钟鼓社区居委会', '111');
INSERT INTO `position_village` VALUES ('17', null, '北京市', '110100000000', '市辖区', '110101000000', '东城区', '110101002000', '景山街道办事处', '110101002005', '魏家社区居委会', '111');

2018 年完整的插入数据获取:
链接:https://pan.baidu.com/s/1kAQRACj4EDTDx2rGxaHT5g
提取码:szke

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值