MYSQL中导入中国各个省份的数据
一,表设计
编辑
建表SQL语句
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for sys_province
-- ----------------------------
DROP TABLE IF EXISTS `sys_province`;
CREATE TABLE `sys_province` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省份名称',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否启用 1-启用; 0-禁用',
`create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后更新人',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '最后更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 72 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '省份表' ROW_FORMAT = Dynamic;
二,数据导入
导入数据SQL,其中id为身份证上各个省的编号
INSERT INTO `sys_province` VALUES (11, '北京市', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:48');
INSERT INTO `sys_province` VALUES (12, '天津市', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:50');
INSERT INTO `sys_province` VALUES (13, '河北省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:50');
INSERT INTO `sys_province` VALUES (14, '山西省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:52');
INSERT INTO `sys_province` VALUES (15, '内蒙古自治区', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:52');
INSERT INTO `sys_province` VALUES (21, '辽宁省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:53');
INSERT INTO `sys_province` VALUES (22, '吉林省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:53');
INSERT INTO `sys_province` VALUES (23, '黑龙江省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:53');
INSERT INTO `sys_province` VALUES (31, '上海市', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:54');
INSERT INTO `sys_province` VALUES (32, '江苏省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:54');
INSERT INTO `sys_province` VALUES (33, '浙江省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:54');
INSERT INTO `sys_province` VALUES (34, '安徽省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:55');
INSERT INTO `sys_province` VALUES (35, '福建省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:55');
INSERT INTO `sys_province` VALUES (36, '江西省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:55');
INSERT INTO `sys_province` VALUES (37, '山东省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:56');
INSERT INTO `sys_province` VALUES (41, '河南省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:56');
INSERT INTO `sys_province` VALUES (42, '湖北省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:21:56');
INSERT INTO `sys_province` VALUES (43, '湖南省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (44, '广东省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (45, '广西壮族自治区', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (46, '海南省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (50, '重庆市', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (51, '四川省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (52, '贵州省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (53, '云南省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (54, '西藏自治区', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (61, '陕西省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (62, '甘肃省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (63, '青海省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (64, '宁夏回族自治区', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (65, '新疆维吾尔自治区', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (71, '台湾省', 1, 'admin', '2022-07-14 11:21:37', NULL, '2022-07-14 11:22:00');
INSERT INTO `sys_province` VALUES (81, '香港特别行政区', 1, 'admin', '2022-07-20 15:48:35', NULL, '2022-07-20 15:48:35');
INSERT INTO `sys_province` VALUES (82, '澳门特别行政区', 1, 'admin', '2022-07-20 15:48:51', NULL, '2022-07-20 15:48:51');
最终导入效果