欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

关于民族的数据库表设计

程序员文章站 2022-05-08 11:21:09
...

56个名族的数据来源:
http://www.nsfc.gov.cn/publish/portal0/tab560/
关于民族的数据库表设计
参考上面的链接地址,最后修改后得到下面的内容:
关于民族的数据库表设计
可以发现,有这样的三列固定值,分为是:民族序号、名族的全称以及他的简称,这个简称在那个基金会网址上是没有的,但是我们的身份证上面总是有这么一个民族 汉,这个就是民族的简称,因此这一列也应该是固定不动的。

关于民族的数据库表设计
设计的表如下
关于民族的数据库表设计

DROP TABLE IF EXISTS `base_nation`;
CREATE TABLE `base_nation` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `code` varchar(100) NOT NULL COMMENT '代码',
  `content` varchar(100) NOT NULL COMMENT '民族',
  `short_name` varchar(20) DEFAULT NULL '简称',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COMMENT='民族数据';

对应的插入数据为:

BEGIN;
INSERT INTO `base_nation` VALUES ('1', '01', '汉族', '汉', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('2', '02', '蒙古族', '蒙', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('3', '03', '回族', '回', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('4', '04', '藏族', '藏', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('5', '05', '*', '维', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('6', '06', '苗族', '苗', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('7', '07', '彝族', '彝', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('8', '08', '壮族', '壮', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('9', '09', '布依族', '依', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('10', '10', '朝鲜族', '朝', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('11', '11', '满族', '满', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('12', '12', '侗族', '侗', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('13', '13', '瑶族', '瑶', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('14', '14', '白族', '白', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('15', '15', '土家族', '家', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('16', '16', '哈尼族', '尼', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('17', '17', '哈萨克族', '萨', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('18', '18', '傣族', '傣', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('19', '19', '黎族', '黎', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('20', '20', '傈僳族', '僳', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('21', '21', '佤族', '佤', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('22', '22', '畲族', '畲', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('23', '23', '高山族', '高', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('24', '24', '拉祜族', '祜', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('25', '25', '水族', '水', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('26', '26', '东乡族', '东', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('27', '27', '纳西族', '西', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('28', '28', '景颇族', '景', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('29', '29', '柯尔克孜族', '柯', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('30', '30', '土族', '土', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('31', '31', '达斡尔族', '达', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('32', '32', '仫佬族', '仫', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('33', '33', '羌族', '羌', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('34', '34', '布朗族', '朗', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('35', '35', '撒拉族', '撒', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('36', '36', '毛难族', '毛', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('37', '37', '仡佬族', '仡', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('38', '38', '锡伯族', '锡', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('39', '39', '阿昌族', '阿', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('40', '40', '普米族', '普', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('41', '41', '塔吉克族', '吉', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('42', '42', '怒族', '怒', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('43', '43', '乌孜别克族', '乌', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('44', '44', '俄罗斯族', '罗', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('45', '45', '鄂温克族', '温', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('46', '46', '崩龙族', '德', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('47', '47', '保安族', '保', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('48', '48', '裕固族', '裕', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('49', '49', '京族', '京', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('50', '50', '塔塔尔族', '塔', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('51', '51', '独龙族', '龙', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('52', '52', '鄂伦春族', '春', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('53', '53', '赫哲族', '哲', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('54', '54', '门巴族', '门', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('55', '55', '珞巴族', '珞', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('56', '56', '基诺族', '基', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('57', '57', '其他', '其他', '2020-02-14 11:38:59', null);
INSERT INTO `base_nation` VALUES ('58', '58', '外国血统', '外国血统', '2020-02-14 11:38:59', null);
COMMIT;