转载自: https://blog.csdn.net/xiaofanku/article/details/18085865
身份证号码的意义
①前1、2位数字表示:所在省份的代码;
②第3、4位数字表示:所在城市的代码;
③第5、6位数字表示:所在区县的代码;
SQL源码:链接:https://pan.baidu.com/s/1NOMomMsnRDm7yjobmM7kEg 提取码:3rna
部分源码参考:
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for area_code
-- ----------------------------
DROP TABLE IF EXISTS `area_code`;
CREATE TABLE `area_code` (
`id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`province` int(2) NOT NULL,
`city` int(4) DEFAULT NULL,
`zone` int(6) DEFAULT NULL,
`desc` varchar(55) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14185 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of area_code
-- ----------------------------
INSERT INTO `area_code` VALUES ('9457', '11', '1100', '110000', '北京市');
INSERT INTO `area_code` VALUES ('9458', '11', '1101', '110100', '北京市市辖区');
INSERT INTO `area_code` VALUES ('9459', '11', '1101', '110101', '北京市东城区');
INSERT INTO `area_code` VALUES ('9460', '11', '1101', '110102', '北京市西城区');
INSERT INTO `area_code` VALUES ('9461', '11', '1101', '110103', '北京市崇文区');
INSERT INTO `area_code` VALUES ('9462', '11', '1101', '110104', '北京市宣武区');
INSERT INTO `area_code` VALUES ('9463', '11', '1101', '110105', '北京市朝阳区');
INSERT INTO `area_code` VALUES ('9464', '11', '1101', '110106', '北京市丰台区');
INSERT INTO `area_code` VALUES ('9465', '11', '1101', '110107', '北京市石景山区');
INSERT INTO `area_code` VALUES ('9466', '11', '1101', '110108', '北京市海淀区');
INSERT INTO `area_code` VALUES ('9467', '11', '1101', '110109', '北京市门头沟区');
INSERT INTO `area_code` VALUES ('9468', '11', '1101', '110111', '北京市房山区');
INSERT INTO `area_code` VALUES ('9469', '11', '1101', '110112', '北京市通州区');
INSERT INTO `area_code` VALUES ('9470', '11', '1101', '110113', '北京市顺义区');
INSERT INTO `area_code` VALUES ('9471', '11', '1101', '110114', '北京市昌平区');
INSERT INTO `area_code` VALUES ('9472', '11', '1101', '110115', '北京市大兴区');
INSERT INTO `area_code` VALUES ('9473', '11', '1101', '110116', '北京市怀柔区');
INSERT INTO `area_code` VALUES ('9474', '11', '1101', '110117', '北京市平谷区');
INSERT INTO `area_code` VALUES ('9475', '11', '1102', '110200', '北京市市辖县');
INSERT INTO `area_code` VALUES ('9476', '11', '1102', '110221', '北京市昌平县');
INSERT INTO `area_code` VALUES ('9477', '11', '1102', '110222', '北京市顺义县');
INSERT INTO `area_code` VALUES ('9478', '11', '1102', '110223', '北京市通县');
INSERT INTO `area_code` VALUES ('9479', '11', '1102', '110224', '北京市大兴县');
INSERT INTO `area_code` VALUES ('9480', '11', '1102', '110226', '北京市平谷县');
INSERT INTO `area_code` VALUES ('9481', '11', '1102', '110227', '北京市怀柔县');
INSERT INTO `area_code` VALUES ('9482', '11', '1102', '110228', '北京市密云县');
INSERT INTO `area_code` VALUES ('9483', '11', '1102', '110229', '北京市延庆县');