MySQL实训--原神数据库

news2024/12/23 5:48:27

原神数据库

  • er图
  • DDL/DML语句
  • 查询语句
  • 存储过程/触发器

er图

在这里插入图片描述
在这里插入图片描述

DDL/DML语句

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

DROP TABLE IF EXISTS `artifacts`;
CREATE TABLE `artifacts`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `artifacts_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `set_bonus` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '套装效果',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 52 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;

INSERT INTO `artifacts` VALUES (1, '冒险家', '开启各类宝箱后的5秒内,持续恢复30%生命值。');
INSERT INTO `artifacts` VALUES (2, '幸运儿', '拾取摩拉时,恢复300点生命值。');
INSERT INTO `artifacts` VALUES (3, '游医', '释放元素爆发时,恢复20%生命值。');
INSERT INTO `artifacts` VALUES (4, '行者之心', '重击的暴击率提升30%。');
INSERT INTO `artifacts` VALUES (5, '奇迹', '受到某个元素类型的伤害后,相应的抗性提升30%,持续10秒。该效果每10秒只能触发一次。');
INSERT INTO `artifacts` VALUES (6, '战狂', '生命值低于70%时,暴击率额外提升24%。');
INSERT INTO `artifacts` VALUES (7, '教官', '触发元素反应后,队伍中所有角色的元素精通提高120点,持续8秒。');
INSERT INTO `artifacts` VALUES (8, '流放者', '施放元素爆发后,每2秒为队伍中所有角色(不包括自己)恢复2点元素能量。该效果持续6秒,无法叠加。');
INSERT INTO `artifacts` VALUES (9, '守护之心', '队伍里每有不同—种元素类型的自己的角色,自身获得30%相应的元素抗性。');
INSERT INTO `artifacts` VALUES (10, '勇士之心', '对生命值高于50%的敌人,造成的伤害增加30%。');
INSERT INTO `artifacts` VALUES (11, '武人', '释放元素战技后的8秒内,普通攻击和重击造成的伤害提升25%。');
INSERT INTO `artifacts` VALUES (12, '赌徒', '打倒敌人时,有100%概率清除元素战技的冷却时间。该效果每15秒至多触发—次。');
INSERT INTO `artifacts` VALUES (13, '学士', '获得元素微粒或元素晶球时,队伍中所有弓箭和法器角色额外恢复3点元素能量。该效果每3秒只能触发一次。');
INSERT INTO `artifacts` VALUES (14, '祭火之人', '受到的火元素附着效果的持续时间减少40%。');
INSERT INTO `artifacts` VALUES (15, '祭水之人', '受到的水元素附着效果的持续时间减少40%。');
INSERT INTO `artifacts` VALUES (16, '祭雷之人', '受到的雷元素附着效果的持续时间减少40%。');
INSERT INTO `artifacts` VALUES (17, '祭冰之人', '受到的冰元素附着效果的持续时间减少40%。');
INSERT INTO `artifacts` VALUES (18, '冰封迷途的勇士', '攻击处于冰元素影响下的敌人时,暴击率提高20%;若敌人处于冻结状态下,则暴击率额外提高20%。');
INSERT INTO `artifacts` VALUES (19, '平息鸣雷的尊者', '对处于雷元素影响下的敌人造成的伤害提升35%。');
INSERT INTO `artifacts` VALUES (20, '渡过烈火的贤人', '对处于火元素影响下的敌人造成的伤害提升35%。');
INSERT INTO `artifacts` VALUES (21, '被怜爱的少女', '施放元素战技或元素爆发后的10秒内,队伍中所有角色受治疗效果加成提高20%。');
INSERT INTO `artifacts` VALUES (22, '角斗士的终幕礼', '装备该圣遗物套装的角色为单手剑、双手剑、长柄武器角色时,角色普通攻击造成的伤害提高35%。');
INSERT INTO `artifacts` VALUES (23, '翠绿之影', '扩散反应造成的伤害提升60%。根据扩散的元素类型,降低受到影响的敌人40%的对应元素抗性,持续10秒。');
INSERT INTO `artifacts` VALUES (24, '流浪大地的乐章', '装备该圣遗物套装的角色为法器、弓箭角色时,角色重击造成的伤害提高35%。');
INSERT INTO `artifacts` VALUES (25, '如雷的盛怒', '超载、感电、超导、超绽放反应造成的伤害提升40%,超激化反应带来的伤害提升提高20%。触发上述元素反应或原激化反应时,元素战技冷却时间减少1秒。该效果每0.8秒最多触发—次。');
INSERT INTO `artifacts` VALUES (26, '炽烈的炎之魔女', '超载、燃烧、烈绽放反应造成的伤害提升40%,蒸发、融化反应的加成系数提高15%。施放元素战技后的10秒内,2件套的效果提高50%,该效果最多叠加3次。');
INSERT INTO `artifacts` VALUES (27, '昔日宗室之仪', '释放元素爆发后,队伍中所有角色攻击力提升20%,持续12秒,该效果不可叠加。');
INSERT INTO `artifacts` VALUES (28, '染血的骑士道', '击败敌人后的10秒内,施放重击时不消耗体力,且重击造成的伤害提升50%。');
INSERT INTO `artifacts` VALUES (29, '悠古的磐岩', '获得结晶反应形成的晶片时,队伍中所有角色获得35%对应元素伤害加成,持续10秒。同时只能通过该效果获得一种元素伤害加成。');
INSERT INTO `artifacts` VALUES (30, '逆飞的流星', '处于护盾庇护下时,额外获得40%普通攻击和重击伤害加成。');
INSERT INTO `artifacts` VALUES (31, '沉沦之心', '施放元素战技后的15秒内,普通攻击与重击造成的伤害提高30%。');
INSERT INTO `artifacts` VALUES (32, '千岩牢固', '元素战技命中敌人后,使队伍中附近的所有角色攻击力提升20%,护盾强效提升30%,持续3秒。该效果每0.5秒至多触发一次。装备此圣遗物套装的角色处于队伍后台时,依然育能触发该效果。');
INSERT INTO `artifacts` VALUES (33, '苍白之火', '元素战技命中敌人后,攻击力提升9%。该效果持续7秒,至多叠加2层,每0.3秒至多触发一次。叠满2层时,2件套的效果提升100%。');
INSERT INTO `artifacts` VALUES (34, '追忆之注连', '释放元素战技时,如果角色的元素能星高于或等于15点,则会流失15点元素能量,使接下来的10秒内,普通攻击、重击、下落攻击造成的伤害提高50%,持续期间内效果不会再次触发。');
INSERT INTO `artifacts` VALUES (35, '绝缘之旗印', '基于元素充能效率的25%,提高元素爆发造成的伤害。至多通过这种方式获得75%提升。');
INSERT INTO `artifacts` VALUES (36, '华馆梦醒形骸记', '装备此圣遗物套装的角色在以下情况下,将获得「问答」效果:在场上用岩元素攻击命中敌人后获得一层,每0.3秒至多触发一次;在队伍后台中,每3秒获得一层。问答至多叠加4层,每层能提供6%防御力与6%岩元素伤害加成。每6秒,若未获得问答效果,将损失一层。');
INSERT INTO `artifacts` VALUES (37, '海染砗磲', '装备此圣遗物套装的角色对队伍中的角色进行治疗时,将产生持续3秒的海染泡沫,记录治疗的生命值回复量(包括溢出值)。持续时间结束时,海染泡沫将会爆炸,对周围的敌人造成90%累计回复量的伤害(该伤害结算方式同感电、超导等元素反应,但不受元素精通、等级或反应伤害加成效果影响)。每3.5秒至多产生一个海染泡沬;海染泡沫至多记录30000点回复量,含溢出部分的治疗量;自己的队伍中同时至多存在一个海染泡沫。装备此圣遗物套装的角色处于队伍后台时;依然能触发该效果。');
INSERT INTO `artifacts` VALUES (38, '辰砂往生录', '施放元素爆发后,将产生持续16秒的「潜光」效果:攻击力提升8%;并在角色的生命值降低时,攻击力进一步提升10%,至多通过这种方式提升4次,每0.8秒至多触发一次。「潜光」效果将在角色退场时消失;持续期间再次施放元素爆发,将移除原有的「潜光」。');
INSERT INTO `artifacts` VALUES (39, '来歆余响', '普通攻击命中敌人时,有36%概率触发「幽谷祝祀」︰普通攻击造成的伤害提高,伤害提高值为攻击力的70%,该效果将在普通攻击造成伤害后的0.05秒后清除。普通攻击未触发「幽谷祝祀」时,会使下次触发概率提升20%;0.2秒内至多判定1次触发与否。');
INSERT INTO `artifacts` VALUES (40, '深林的记忆', '元素战技或元素爆发命中敌人后,使命中目标的草元素抗性降低30%,持续8秒。装备者处于队伍后台时,依然能触发该效果。');
INSERT INTO `artifacts` VALUES (41, '饰金之梦', '触发元素反应后的8秒内,会根据队伍内其他角色的元素类型,使装备者获得强化:队伍中每存在1个和装备者同类元素的角色,攻击力提升14%;每存在1个和装备者不同元素类型的角色,元素精通提升50点。上述每类效果至多计算3个角色。该效果每8秒至多触发一次。装备者处于队伍后台时,依然能触发该效果。');
INSERT INTO `artifacts` VALUES (42, '沙上楼阁史话', '重击命中敌人后,该角色的普通攻击速度提升10%,普通攻击、重击与下落攻击造成的伤害提升40%,持续15秒。');
INSERT INTO `artifacts` VALUES (43, '乐园遗落之花', '装备者绽放、超绽放、烈绽放反应造成的伤害提升40%。此外,装备者触发绽放、超绽放、烈绽放后,上述效果带来的加成提升25%,该效果持续10秒,至多叠加4次,每1秒至多触发一次。装备者处于队伍后台时依然能触发该效果。');
INSERT INTO `artifacts` VALUES (44, '水仙之梦', '普通攻击、重击、下落攻击、元素战技或元素爆发命中敌人后,将产生1层持续8秒的「镜中水仙」效果。处于1/2/3层及以上「镜中水仙」效果下时,攻击力将提高7%/16%/25%,水元素伤害加成提升4%/9%/15%。由普通攻击、重击、下落攻击、元素战技或元素爆发产生的「镜中水仙」将分别独立存在。');
INSERT INTO `artifacts` VALUES (45, '花海甘露之光', '元素战技与元素爆发造成的伤害提升10%;装备者受到伤害后的5秒内,上述伤害提升效果提高80%。该提高效果至多叠加5层。每层持续时间独立计算,处于队伍后台时依然能触发该效果。');
INSERT INTO `artifacts` VALUES (46, '逐影猎人', '当前生命值提升或降低时,暴击率提升12%,该效果持续5秒,至多叠加3次。');
INSERT INTO `artifacts` VALUES (47, '黄金剧团', '元素战技造成的伤害提升25%;此外,处于队伍后台时,元素战技造成的伤害还将进一步提升25%,该效果将在登场后2秒移除。');
INSERT INTO `artifacts` VALUES (48, '昔时之歌', '装备者对队伍中的角色进行治疗时将产生持续6秒的渴盼效果,记录治疗的生命值回复量(包括溢出值)。持续时间结束时,渴盼效果将转变为「彼时的浪潮」效果:队伍中自己的当前场上角色的普通攻击、重击、下落攻击、元素战技与元素爆发命中敌人时,将基于渴盼效果所记录的回复量的8%提高造成的伤害,「彼时的浪潮」将在生效5次或10秒后移除。一次渴盼效果至多记录15000点回复量,同时至多存在一个能够记录多个装备者的产生的回复量;装备者处于队伍后台时,依然能触发该效果。');
INSERT INTO `artifacts` VALUES (49, '回声之林夜话', '施放元素战技后的10秒内,岩元素伤害加成提升20%;若处于结晶反应产生的护盾庇护下,上述效果提高150%,进一步提高的效果将在失去结晶护盾庇护的1秒后移除。');
INSERT INTO `artifacts` VALUES (50, '谐律异想断章', '生命之契的数值提升或降低时角色造成的伤害提升18%,该效果持续6秒,至多叠加3次。');
INSERT INTO `artifacts` VALUES (51, '未竟的遐思', '脱离战斗状态3秒后,造成的伤害提升50%。在战斗状态下,附近不存在处于燃烧状态下的敌人超过6秒后,上述伤害提升效果每秒降低10%直到降低至0%;存在处于燃烧状态下的敌人时,每秒提升10%,直到达到50%。装备此圣遗物套装的角色处于队伍后台时,依然会触发该效果。');

DROP TABLE IF EXISTS `artifacts_select`;
CREATE TABLE `artifacts_select`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `artifacts_id` int NOT NULL,
  `user_id` int NULL DEFAULT NULL,
  `flower_of_life` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生之花',
  `plume_of_death` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '死之羽',
  `sands_of_eon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '时之沙',
  `goblet_of_eonothem` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '空之杯',
  `circlet_of_logos` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '理之冠',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `dacishuwang`(`artifacts_id`) USING BTREE,
  INDEX `zhixingguansanbing`(`user_id`) USING BTREE,
  CONSTRAINT `dacishuwang` FOREIGN KEY (`artifacts_id`) REFERENCES `artifacts` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `zhixingguansanbing` FOREIGN KEY (`user_id`) REFERENCES `user` (`ID`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;

INSERT INTO `artifacts_select` VALUES (1, 41, 68, '4780', '311', '187精通', '46.6%草伤', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (2, 18, 57, '4780', '311', '46.6%攻击', '46.6%冰杯', '46.6%生命');
INSERT INTO `artifacts_select` VALUES (3, 19, 58, '4780', '311', '51.8%充能', '46.6%雷杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (4, 35, 42, '4780', '311', '51.8%充能', '46.6%水杯', '62.2%爆伤');
INSERT INTO `artifacts_select` VALUES (5, 47, 76, '4780', '165', '46.6%生命', '46.6%水杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (6, 42, 69, '4780', '311', '46.6%攻击', '46.6%风杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (7, 42, 56, '4780', '311', '46.6%攻击', '46.6%风杯', '62.2%爆伤');
INSERT INTO `artifacts_select` VALUES (8, 26, 65, '4780', '311', '46.6%生命', '46.6%火杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (9, 26, 53, '4780', '311', '46.6%攻击', '46.6%火杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (10, 33, 33, '4780', '200', '46.6%攻击', '46.6%物伤', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (11, 31, 55, '4780', '311', '46.6%攻击', '46.6%岩杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (12, 39, 84, '4780', '555', '46.6%生命', '46.6%岩杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (13, 30, 54, '4780', '311', '46.6%治疗加成', '46.6%岩杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (14, 30, 67, '4780', '311', '51.8%充能', '46.6%岩杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (15, 26, 68, '4780', '311', '51.8%充能', '46.6%岩杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (16, 37, 77, '4780', '232', '51.8%充能', '46.6%岩杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (17, 27, 78, '4780', '311', '187精通', '46.6%岩杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (18, 37, 76, '4780', '311', '46.6%攻击', '46.6%岩杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (19, 24, 85, '4780', '311', '187精通', '46.6%岩杯', '31.1%暴率');
INSERT INTO `artifacts_select` VALUES (20, 22, 77, '4780', '311', '46.6%生命', '46.6%岩杯', '31.1%暴率');

DROP TABLE IF EXISTS `talent`;
CREATE TABLE `talent`  (
  `user_id` int NOT NULL,
  `normal_attack` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `E` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `Q` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`user_id`) USING BTREE,
  CONSTRAINT `qiyejun` FOREIGN KEY (`user_id`) REFERENCES `user` (`ID`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;

INSERT INTO `talent` VALUES (53, '10', '10', '10');
INSERT INTO `talent` VALUES (57, '10', '9', '8');
INSERT INTO `talent` VALUES (58, '9', '10', '10');
INSERT INTO `talent` VALUES (68, '10', '10', '10');
INSERT INTO `talent` VALUES (69, '10', '10', '10');
INSERT INTO `talent` VALUES (76, '9', '9', '9');
INSERT INTO `talent` VALUES (82, '10', '10', '10');
INSERT INTO `talent` VALUES (84, '10', '10', '10');
INSERT INTO `talent` VALUES (85, '10', '10', '10');
INSERT INTO `talent` VALUES (86, '10', '10', '10');

DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `userName` varchar(255) NOT NULL COMMENT '角色名\r\n',
  `weapon_type_id` int NOT NULL COMMENT '武器类型',
  `dendro` varchar(255) NOT NULL COMMENT '元素类型',
  `rarity` varchar(255) NOT NULL COMMENT '稀有度',
  `weapon_id` int DEFAULT NULL COMMENT '武器id',
  `weapon_grade` int DEFAULT '90' COMMENT '武器等级',
  `artifacts_id` int DEFAULT NULL COMMENT '圣遗物id',
  `user_level` int DEFAULT NULL COMMENT '角色等级',
  PRIMARY KEY (`ID`) USING BTREE,
  UNIQUE KEY `weapon_id` (`weapon_id`,`artifacts_id`) USING BTREE,
  KEY `bengbeng123` (`weapon_type_id`) USING BTREE,
  CONSTRAINT `bengbeng123` FOREIGN KEY (`weapon_type_id`) REFERENCES `weapon_type` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

INSERT INTO `user` VALUES (1, '安柏', 5, '火', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (2, '凯亚', 2, '冰', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (3, '丽莎', 4, '雷', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (4, '芭芭拉', 4, '水', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (5, '雷泽', 1, '雷', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (6, '香菱', 3, '火', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (7, '北斗', 1, '雷', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (8, '行秋', 2, '水', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (9, '凝光', 4, '岩', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (10, '菲谢尔', 5, '雷', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (11, '班尼特', 2, '火', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (12, '诺艾尔', 1, '岩', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (13, '重云', 1, '冰', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (14, '砂糖', 4, '风', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (15, '迪奥娜', 5, '冰', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (16, '辛焱', 1, '火', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (17, '罗莎莉亚', 3, '冰', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (18, '烟绯', 4, '火', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (19, '早柚', 1, '风', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (20, '九条裟罗', 5, '雷', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (21, '托马', 3, '火', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (22, '五郎', 5, '岩', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (23, '云堇', 3, '岩', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (24, '久岐忍', 2, '雷', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (25, '鹿野院平藏', 4, '风', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (26, '柯莱', 5, '草', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (27, '多莉', 1, '雷', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (28, '坎蒂丝', 3, '水', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (29, '莱依拉', 2, '冰', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (30, '珐露珊', 5, '风', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (31, '瑶瑶', 3, '草', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (32, '米卡', 3, '冰', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (33, '卡维', 1, '草', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (34, '绮良良', 2, '草', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (35, '琳妮特', 2, '风', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (36, '菲米尼', 1, '冰', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (37, '夏洛蒂', 4, '冰', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (38, '夏沃蕾', 3, '火', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (39, '嘉明', 1, '火', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (40, '赛索斯', 5, '雷', '4', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (41, '琴', 2, '风', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (42, '迪卢克', 1, '火', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (43, '七七', 2, '冰', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (44, '莫娜', 4, '水', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (45, '刻晴', 2, '雷', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (46, '温迪', 5, '风', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (47, '可莉', 4, '火', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (48, '达达利亚', 5, '水', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (49, '钟离', 3, '岩', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (50, '阿贝多', 2, '岩', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (51, '甘雨', 5, '冰', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (52, '魈', 3, '风', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (53, '胡桃', 3, '火', '5', 99, 90, 9, 90);
INSERT INTO `user` VALUES (54, '优菈', 1, '冰', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (55, '枫原万叶', 2, '风', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (56, '神里绫华', 2, '冰', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (57, '宵宫', 5, '火', '5', 169, 90, 2, 90);
INSERT INTO `user` VALUES (58, '雷电将军', 3, '雷', '5', 100, 90, 3, 90);
INSERT INTO `user` VALUES (59, '珊瑚宫心海', 4, '水', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (60, '荒泷一斗', 1, '岩', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (61, '申鹤', 3, '冰', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (62, '八重神子', 4, '雷', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (63, '神里绫人', 2, '水', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (64, '夜兰', 5, '水', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (65, '提纳里', 5, '草', '5', NULL, NULL, 8, NULL);
INSERT INTO `user` VALUES (66, '赛诺', 3, '雷', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (67, '妮露', 2, '水', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (68, '纳西妲', 4, '草', '5', 135, 90, 1, 90);
INSERT INTO `user` VALUES (69, '流浪者', 4, '风', '5', 136, 90, 6, 90);
INSERT INTO `user` VALUES (70, '艾尔海森', 2, '草', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (71, '迪希雅', 1, '火', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (72, '白术', 4, '草', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (73, '林尼', 5, '火', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (74, '那维莱特', 4, '水', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (75, '莱欧斯利', 4, '冰', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (76, '芙宁娜', 2, '水', '5', 70, 90, 5, 90);
INSERT INTO `user` VALUES (77, '娜维娅', 1, '岩', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (78, '闲云', 4, '风', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (79, '千织', 2, '岩', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (80, '阿蕾奇诺', 3, '火', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (81, '克洛琳德', 2, '雷', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (82, '希格雯', 5, '水', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (83, '埃洛伊', 5, '冰', '5', NULL, NULL, NULL, NULL);
INSERT INTO `user` VALUES (84, '执行官散兵', 2, '雷', '6', 136, 90, 12, 90);
INSERT INTO `user` VALUES (85, '倾奇者', 2, '雷', '7', 136, 90, NULL, 90);
INSERT INTO `user` VALUES (86, '大慈树王', 4, '草', '7', NULL, NULL, 19, 90);



CREATE TABLE `weapon` (
  `id` int NOT NULL AUTO_INCREMENT,
  `weapon_type_id` int DEFAULT NULL,
  `rarity` varchar(255) DEFAULT NULL,
  `weapon_name` varchar(255) DEFAULT NULL,
  `weapon_details` varchar(255) DEFAULT NULL,
  `weapon_level` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `nahida66` (`weapon_type_id`) USING BTREE,
  CONSTRAINT `nahida66` FOREIGN KEY (`weapon_type_id`) REFERENCES `weapon_type` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=176 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;









INSERT INTO `weapon` VALUES (1, 1, '1', '训练大剑', '185攻击力', NULL);
INSERT INTO `weapon` VALUES (2, 1, '2', '佣兵重剑', '243攻击力', NULL);
INSERT INTO `weapon` VALUES (3, 1, '3', '铁影阔剑', '401攻击力35.2%生命值', NULL);
INSERT INTO `weapon` VALUES (4, 1, '3', '白铁大剑', '401攻击力43.9%防御力', NULL);
INSERT INTO `weapon` VALUES (5, 1, '3', '以理服人', '401攻击力35.2%攻击力', NULL);
INSERT INTO `weapon` VALUES (6, 1, '3', '飞天大御剑', '401攻击力43.9%物理伤害加成', NULL);
INSERT INTO `weapon` VALUES (7, 1, '4', '西风大剑', '454攻击力61.3%充能', NULL);
INSERT INTO `weapon` VALUES (8, 1, '4', '钟剑', '510攻击力41.3%生命', NULL);
INSERT INTO `weapon` VALUES (9, 1, '4', '祭礼大剑', '565攻击力30.6%元素效率', NULL);
INSERT INTO `weapon` VALUES (10, 1, '4', '宗室大剑', '565攻击力27.6%攻击力', NULL);
INSERT INTO `weapon` VALUES (11, 1, '4', '雨裁', '510攻击力165精通', NULL);
INSERT INTO `weapon` VALUES (12, 1, '4', '试作古华', '565攻击力27.6%攻击', NULL);
INSERT INTO `weapon` VALUES (13, 1, '4', '白影剑', '510攻击力51.7%防御力', NULL);
INSERT INTO `weapon` VALUES (14, 1, '4', '黑岩斩刀', '510攻击力55.1%暴伤', NULL);
INSERT INTO `weapon` VALUES (15, 1, '4', '螭骨剑', '510攻击力27.6%暴率', NULL);
INSERT INTO `weapon` VALUES (16, 1, '4', '雪葬的星银', '565攻击力34.5%物伤', NULL);
INSERT INTO `weapon` VALUES (17, 1, '4', '千岩古剑', '510攻击力41.3%攻击', NULL);
INSERT INTO `weapon` VALUES (18, 1, '4', '桂木斩长正', '510攻击力45.9%充能', NULL);
INSERT INTO `weapon` VALUES (19, 1, '4', '恶王丸', '510攻击力41.3%攻击', NULL);
INSERT INTO `weapon` VALUES (20, 1, '4', '森林王器', '565攻击力30.6%元素效率', NULL);
INSERT INTO `weapon` VALUES (21, 1, '4', '玛海菈的水色', '510攻击力165精通', NULL);
INSERT INTO `weapon` VALUES (22, 1, '4', '饰铁之花', '565攻击力110精通', NULL);
INSERT INTO `weapon` VALUES (23, 1, '4', '聊聊棒', '565攻击力18.4暴率', NULL);
INSERT INTO `weapon` VALUES (24, 1, '4', '浪影阔剑', '510攻击力41.3%攻击', NULL);
INSERT INTO `weapon` VALUES (25, 1, '4', '便携动力锯', '454攻击力55.1%生命', NULL);
INSERT INTO `weapon` VALUES (26, 1, '4', '究极霸王超级魔剑', '510攻击力41.3%攻击', NULL);
INSERT INTO `weapon` VALUES (27, 1, '5', '天空之傲', '674攻击力36.8%充能', NULL);
INSERT INTO `weapon` VALUES (28, 1, '5', '狼的末路', '608攻击力49.6%攻击力', NULL);
INSERT INTO `weapon` VALUES (29, 1, '5', '无工之剑', '608攻击力49.6%攻击力', NULL);
INSERT INTO `weapon` VALUES (30, 1, '5', '松籁响起之时', '741攻击力20.7物伤', NULL);
INSERT INTO `weapon` VALUES (31, 1, '5', '赤角石溃杵', '542攻击力88.2爆伤', NULL);
INSERT INTO `weapon` VALUES (32, 1, '5', '苇海信标', '608攻击力33.1%暴率', NULL);
INSERT INTO `weapon` VALUES (33, 1, '5', '裁断', '674攻击力22.1%暴率', NULL);
INSERT INTO `weapon` VALUES (34, 2, '1', '无锋剑', '185攻击力', NULL);
INSERT INTO `weapon` VALUES (35, 2, '2', '银剑', '243攻击力', NULL);
INSERT INTO `weapon` VALUES (36, 2, '3', '冷刃', '401攻击力35.2%攻击', NULL);
INSERT INTO `weapon` VALUES (37, 2, '3', '黎明神剑', '401攻击力46.9%爆伤', NULL);
INSERT INTO `weapon` VALUES (38, 2, '3', '旅行剑', '448攻击力29.3%防御力', NULL);
INSERT INTO `weapon` VALUES (39, 2, '3', '吃虎鱼刀', '401攻击力35.2%攻击', NULL);
INSERT INTO `weapon` VALUES (40, 2, '3', '飞天御剑', '354攻击力52.1%充能', NULL);
INSERT INTO `weapon` VALUES (41, 2, '4', '西风剑', '454攻击力61.3%充能', NULL);
INSERT INTO `weapon` VALUES (42, 2, '4', '笛剑', '510攻击力41.3%攻击', NULL);
INSERT INTO `weapon` VALUES (43, 2, '4', '祭礼剑', '454攻击力61.3%充能', NULL);
INSERT INTO `weapon` VALUES (44, 2, '4', '宗室长剑', '510攻击力41.3攻击', NULL);
INSERT INTO `weapon` VALUES (45, 2, '4', '匣里龙吟', '510攻击力41.3攻击', NULL);
INSERT INTO `weapon` VALUES (46, 2, '4', '试作斩岩', '565攻击力34.5%物伤', NULL);
INSERT INTO `weapon` VALUES (47, 2, '4', '铁蜂刺', '510攻击力165精通', NULL);
INSERT INTO `weapon` VALUES (48, 2, '4', '黑岩长剑', '565攻击力36.8%爆伤', NULL);
INSERT INTO `weapon` VALUES (49, 2, '4', '黑剑', '510攻击力27.6%暴率', NULL);
INSERT INTO `weapon` VALUES (50, 2, '4', '降临之剑', '440攻击力35.2%攻击力', NULL);
INSERT INTO `weapon` VALUES (51, 2, '4', '暗巷闪光', '620攻击力55精通', NULL);
INSERT INTO `weapon` VALUES (52, 2, '4', '天目影打刀', '454攻击力55.1攻击', NULL);
INSERT INTO `weapon` VALUES (53, 2, '4', '笼钓瓶一心', '510攻击力41.3%攻击', NULL);
INSERT INTO `weapon` VALUES (54, 2, '4', '原木刀', '565攻击力30.6%充能', NULL);
INSERT INTO `weapon` VALUES (55, 2, '4', '西福斯的月光', '510攻击力165精通', NULL);
INSERT INTO `weapon` VALUES (56, 2, '4', '狼牙', '510攻击力27.6%暴率', NULL);
INSERT INTO `weapon` VALUES (57, 2, '4', '海渊终曲', '565攻击力27.6%攻击', NULL);
INSERT INTO `weapon` VALUES (58, 2, '4', '灰河渡手', '510攻击力45.9%充能', NULL);
INSERT INTO `weapon` VALUES (59, 2, '4', '船坞长剑', '510攻击力41.3%生命', NULL);
INSERT INTO `weapon` VALUES (60, 2, '4', '水仙十字圣剑', '510攻击力41.3%攻击', NULL);
INSERT INTO `weapon` VALUES (61, 2, '5', '风鹰剑', '674攻击力41.3%物伤', NULL);
INSERT INTO `weapon` VALUES (62, 2, '5', '天空之刃', '608攻击力55.1%充能', NULL);
INSERT INTO `weapon` VALUES (63, 2, '5', '斫峰之刃', '608攻击力49.6%攻击', NULL);
INSERT INTO `weapon` VALUES (64, 2, '5', '磐岩结绿', '542攻击力44.1%暴率', NULL);
INSERT INTO `weapon` VALUES (65, 2, '5', '苍古自由之誓', '608攻击力198精通', NULL);
INSERT INTO `weapon` VALUES (66, 2, '5', '雾切之回光', '674攻击力44.1%爆伤', NULL);
INSERT INTO `weapon` VALUES (67, 2, '5', '波乱月白经津', '608攻击力33.1暴率', NULL);
INSERT INTO `weapon` VALUES (68, 2, '5', '圣显之钥', '542攻击力66.2%生命', NULL);
INSERT INTO `weapon` VALUES (69, 2, '5', '裁叶萃光', '542攻击力88.2%爆伤', NULL);
INSERT INTO `weapon` VALUES (70, 2, '5', '静水流涌之辉', '542攻击力88.2%爆伤', NULL);
INSERT INTO `weapon` VALUES (71, 2, '5', '有乐御簾切', '542攻击力88.2%爆伤', NULL);
INSERT INTO `weapon` VALUES (72, 2, '5', '赦罪', '674攻击力44.1%爆伤', NULL);
INSERT INTO `weapon` VALUES (73, 3, '1', '新手长枪', NULL, NULL);
INSERT INTO `weapon` VALUES (74, 3, '2', '铁尖枪', NULL, NULL);
INSERT INTO `weapon` VALUES (75, 3, '3', '白缨枪', NULL, NULL);
INSERT INTO `weapon` VALUES (76, 3, '3', '钺矛', NULL, NULL);
INSERT INTO `weapon` VALUES (77, 3, '3', '黑缨枪', NULL, NULL);
INSERT INTO `weapon` VALUES (78, 3, '4', '匣里灭辰', NULL, NULL);
INSERT INTO `weapon` VALUES (79, 3, '4', '试作星镰', NULL, NULL);
INSERT INTO `weapon` VALUES (80, 3, '4', '流月针', NULL, NULL);
INSERT INTO `weapon` VALUES (81, 3, '4', '黑岩刺枪', NULL, NULL);
INSERT INTO `weapon` VALUES (82, 3, '4', '决斗之枪', NULL, NULL);
INSERT INTO `weapon` VALUES (83, 3, '4', '西风长枪', NULL, NULL);
INSERT INTO `weapon` VALUES (84, 3, '4', '宗室猎枪', NULL, NULL);
INSERT INTO `weapon` VALUES (86, 3, '4', '龙脊长枪', NULL, NULL);
INSERT INTO `weapon` VALUES (87, 3, '4', '千岩长枪', NULL, NULL);
INSERT INTO `weapon` VALUES (88, 3, '4', '喜多院十文字', NULL, NULL);
INSERT INTO `weapon` VALUES (89, 3, '4', '渔获', NULL, NULL);
INSERT INTO `weapon` VALUES (90, 3, '4', '断浪长鳍', NULL, NULL);
INSERT INTO `weapon` VALUES (91, 3, '4', '贯月矢', NULL, NULL);
INSERT INTO `weapon` VALUES (92, 3, '4', '峡湾长歌', NULL, NULL);
INSERT INTO `weapon` VALUES (93, 3, '4', '公义的报酬', NULL, NULL);
INSERT INTO `weapon` VALUES (94, 3, '4', '勘探钻机', NULL, NULL);
INSERT INTO `weapon` VALUES (95, 3, '4', '沙中伟贤的对答', NULL, NULL);
INSERT INTO `weapon` VALUES (96, 3, '5', '和璞鸢', '674攻击力22.1暴率', NULL);
INSERT INTO `weapon` VALUES (97, 3, '5', '天空之脊', '674攻击力36.8%充能', NULL);
INSERT INTO `weapon` VALUES (98, 3, '5', '贯虹之槊', '608攻击力49.6%攻击', NULL);
INSERT INTO `weapon` VALUES (99, 3, '5', '护摩之杖', '608攻击力66.2%爆伤', NULL);
INSERT INTO `weapon` VALUES (100, 3, '5', '薙草之稻光', '608攻击力55.1%充能', NULL);
INSERT INTO `weapon` VALUES (101, 3, '5', '息灾', '741攻击力16.5%攻击', NULL);
INSERT INTO `weapon` VALUES (102, 3, '5', '赤沙之杖', '542攻击力44.1%暴率', NULL);
INSERT INTO `weapon` VALUES (103, 3, '5', '赤月之形', '674攻击力22.1暴率', NULL);
INSERT INTO `weapon` VALUES (104, 4, '1', '学徒笔记', NULL, NULL);
INSERT INTO `weapon` VALUES (105, 4, '2', '魔导绪论', NULL, NULL);
INSERT INTO `weapon` VALUES (106, 4, '3', '讨龙英杰谭', NULL, NULL);
INSERT INTO `weapon` VALUES (107, 4, '3', '异世界行记', NULL, NULL);
INSERT INTO `weapon` VALUES (108, 4, '3', '翡玉法球', NULL, NULL);
INSERT INTO `weapon` VALUES (109, 4, '3', '甲级宝钰', NULL, NULL);
INSERT INTO `weapon` VALUES (110, 4, '4', '西风秘典', NULL, NULL);
INSERT INTO `weapon` VALUES (111, 4, '4', '流浪乐章', NULL, NULL);
INSERT INTO `weapon` VALUES (114, 4, '4', '祭礼残章', NULL, NULL);
INSERT INTO `weapon` VALUES (115, 4, '4', '宗室秘法录', NULL, NULL);
INSERT INTO `weapon` VALUES (116, 4, '4', '匣里日月', NULL, NULL);
INSERT INTO `weapon` VALUES (117, 4, '4', '试作金珀', NULL, NULL);
INSERT INTO `weapon` VALUES (118, 4, '4', '万国诸海图谱', NULL, NULL);
INSERT INTO `weapon` VALUES (119, 4, '4', '黑岩绯玉', NULL, NULL);
INSERT INTO `weapon` VALUES (120, 4, '4', '昭心', NULL, NULL);
INSERT INTO `weapon` VALUES (121, 4, '4', '忍冬之果', NULL, NULL);
INSERT INTO `weapon` VALUES (122, 4, '4', '暗巷的酒与诗', NULL, NULL);
INSERT INTO `weapon` VALUES (123, 4, '4', '白辰之环', NULL, NULL);
INSERT INTO `weapon` VALUES (124, 4, '4', '盈满之实', NULL, NULL);
INSERT INTO `weapon` VALUES (125, 4, '4', '流浪的晚星', NULL, NULL);
INSERT INTO `weapon` VALUES (126, 4, '4', '遗祀玉珑', NULL, NULL);
INSERT INTO `weapon` VALUES (127, 4, '4', '纯水流华', NULL, NULL);
INSERT INTO `weapon` VALUES (128, 4, '4', '无垠蔚蓝之歌', NULL, NULL);
INSERT INTO `weapon` VALUES (129, 4, '5', '天空之卷', '674攻击力33.1攻击', NULL);
INSERT INTO `weapon` VALUES (130, 4, '5', '四风原典', '608攻击力33.1暴率', NULL);
INSERT INTO `weapon` VALUES (131, 4, '5', '尘世之锁', '608攻击力49.6%攻击力', NULL);
INSERT INTO `weapon` VALUES (132, 4, '5', '不灭月华', '608攻击力49.6%生命', NULL);
INSERT INTO `weapon` VALUES (134, 4, '5', '神乐之真意', '608攻击力66.2爆伤', NULL);
INSERT INTO `weapon` VALUES (135, 4, '5', '千夜浮梦', '542攻击力265精通', NULL);
INSERT INTO `weapon` VALUES (136, 4, '5', '图莱杜拉的回忆', '674攻击力44.1爆伤', NULL);
INSERT INTO `weapon` VALUES (137, 4, '5', '碧落之珑', '608攻击力49.6生命值', NULL);
INSERT INTO `weapon` VALUES (138, 4, '5', '金流监督', '674攻击力22.1暴率', NULL);
INSERT INTO `weapon` VALUES (139, 4, '5', '万世涌流大典', '542攻击力88.2%爆伤', NULL);
INSERT INTO `weapon` VALUES (140, 4, '5', '鹤鸣余音', '741攻击力16.5%攻击', NULL);
INSERT INTO `weapon` VALUES (141, 5, '1', '猎弓', NULL, NULL);
INSERT INTO `weapon` VALUES (142, 5, '2', '历练的猎弓', NULL, NULL);
INSERT INTO `weapon` VALUES (143, 5, '3', '鸦羽弓', NULL, NULL);
INSERT INTO `weapon` VALUES (144, 5, '3', '神射手之誓', NULL, NULL);
INSERT INTO `weapon` VALUES (145, 5, '3', '反曲弓', NULL, NULL);
INSERT INTO `weapon` VALUES (146, 5, '3', '弹弓', NULL, NULL);
INSERT INTO `weapon` VALUES (147, 5, '3', '信使', NULL, NULL);
INSERT INTO `weapon` VALUES (148, 5, '4', '西风猎弓', NULL, NULL);
INSERT INTO `weapon` VALUES (149, 5, '4', '绝弦', NULL, NULL);
INSERT INTO `weapon` VALUES (150, 5, '4', '祭礼弓', NULL, NULL);
INSERT INTO `weapon` VALUES (151, 5, '4', '宗室长弓', NULL, NULL);
INSERT INTO `weapon` VALUES (152, 5, '4', '弓藏', NULL, NULL);
INSERT INTO `weapon` VALUES (153, 5, '4', '试作澹月', NULL, NULL);
INSERT INTO `weapon` VALUES (154, 5, '4', '钢轮弓', NULL, NULL);
INSERT INTO `weapon` VALUES (155, 5, '4', '黑岩战弓', NULL, NULL);
INSERT INTO `weapon` VALUES (156, 5, '4', '苍翠猎弓', NULL, NULL);
INSERT INTO `weapon` VALUES (157, 5, '4', '暗巷猎手', NULL, NULL);
INSERT INTO `weapon` VALUES (158, 5, '4', '幽夜华尔兹', NULL, NULL);
INSERT INTO `weapon` VALUES (159, 5, '4', '破魔之弓', NULL, NULL);
INSERT INTO `weapon` VALUES (160, 5, '4', '曚云之月', NULL, NULL);
INSERT INTO `weapon` VALUES (161, 5, '4', '王下近侍', NULL, NULL);
INSERT INTO `weapon` VALUES (162, 5, '4', '竭泽', NULL, NULL);
INSERT INTO `weapon` VALUES (163, 5, '4', '烈阳之嗣', NULL, NULL);
INSERT INTO `weapon` VALUES (164, 5, '4', '静谧之曲', NULL, NULL);
INSERT INTO `weapon` VALUES (165, 5, '4', '测距规', NULL, NULL);
INSERT INTO `weapon` VALUES (166, 5, '5', '天空之翼', '674攻击力22.1%暴率', NULL);
INSERT INTO `weapon` VALUES (167, 5, '5', '阿莫斯之弓', '608攻击力49.6%攻击', NULL);
INSERT INTO `weapon` VALUES (168, 5, '5', '终末嗟叹之弓', '608攻击力55.1%充能', NULL);
INSERT INTO `weapon` VALUES (169, 5, '5', '飞雷之弦振', '608攻击力66.2%爆伤', NULL);
INSERT INTO `weapon` VALUES (170, 5, '5', '冬极白星', '608攻击力33.1%暴率', NULL);
INSERT INTO `weapon` VALUES (171, 5, '5', '若水', '542攻击力88.2%爆伤', NULL);
INSERT INTO `weapon` VALUES (172, 5, '5', '猎人之径', '542攻击力44.1%暴率', NULL);
INSERT INTO `weapon` VALUES (173, 5, '5', '最初的大魔术', '608攻击力66.2爆伤', NULL);
INSERT INTO `weapon` VALUES (174, 5, '5', '白雨心弦', NULL, NULL);

DROP TABLE IF EXISTS `weapon_type`;
CREATE TABLE `weapon_type`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `weapon_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '武器类型',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `weapom_type`(`weapon_type`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;

INSERT INTO `weapon_type` VALUES (2, '单手剑');
INSERT INTO `weapon_type` VALUES (1, '双手剑');
INSERT INTO `weapon_type` VALUES (5, '弓');
INSERT INTO `weapon_type` VALUES (4, '法器');
INSERT INTO `weapon_type` VALUES (3, '长柄武器');

SET FOREIGN_KEY_CHECKS = 1;

查询语句

	-- 简单查询
-- 查询每个角色的名称,等级,各项属性,武器,武器等级,武器类型,圣遗物,圣遗物相关属性
select u.userName '角色名',u.rarity '角色等级',u.dendro '属性',w.weapon_name '武器',w.rarity '武器等级',
wt.weapon_type '武器类型',a.artifacts_name '圣遗物',ast.flower_of_life '生之花',ast.plume_of_death '死之羽',ast.sands_of_eon '时之沙',ast.goblet_of_eonothem '空之杯',ast.circlet_of_logos '理之冠' 
from `user` u 
left join weapon w on u.weapon_id=w.id
left join weapon_type wt on u.weapon_type_id=wt.id 
left join artifacts a on u.artifacts_id = a.id
left join artifacts_select ast on u.ID = ast.user_id


-- 索引 查询武器类型编号为2的角色
explain select * from `user` where weapon_type_id='2';

-- 聚合函数 查询各元素角色数量
select dendro,count(*) '各元素角色数量' from `user` group by dendro order by count(*) desc;


-- 复杂查询
-- 查询排除魈后的 五星 风系 使用法器或单手剑或长枪的 角色和角色的武器类型
select u.userName,wt.weapon_type from `user` u 
join weapon_type wt
on u.weapon_type_id = wt.id
where u.rarity > 4 
and u.dendro = '风' 
and u.userName != '魈'
and wt.weapon_type in ('法器','单手剑','长枪');

-- 按元素分组查询各元素所有五星角色的死之羽圣遗物的总攻击力
select dendro '元素',sum(a.plume_of_death) '各元素所有五星角色的死之羽总攻击力' from `user` u
join artifacts_select  a
on a.user_id =u.ID
where rarity >4 
group by dendro 
order by sum(a.plume_of_death) desc;

-- 胡桃,宵宫组成的队伍的一套攻击的伤害
select sum(E)+sum(Q)+sum(normal_attack) as '队伍伤害' from
talent 
where user_id in (select ID from `user` where userName in ('胡桃','宵宫'));

存储过程/触发器

user表插入限制

drop procedure if exists insert_user;
DELIMITER $$
CREATE PROCEDURE insert_user(
    in userName VARCHAR(255), 
    IN weapon_type INT,
    IN dendro VARCHAR(255),   
		in rarity int,
		in user_level int
)
BEGIN
if user_level>90 OR user_level<0 then
	signal sqlstate '45000' set message_text='等级错误';
end if;
    INSERT INTO user (userName, weapon_type_id, dendro,rarity,user_level) VALUES (userName, weapon_type, dendro,rarity,user_level);
END$$

DELIMITER ;

call insert_user('胡桃',1,'火',4,70);

#weapon武器表存储过程

drop procedure if exists insert_weapon;
DELIMITER $$
CREATE PROCEDURE insert_weapon(
    in weapon_type_id int,  
    IN rarity INT,        
    IN weapon_name VARCHAR(255),    
		in weapon_details varchar(255)
)
BEGIN
if	(weapon_type_id < 0 OR weapon_type_id > 5) OR (rarity < 0 OR rarity > 5) then
	signal sqlstate '45000' set message_text='超出类型id限制(1-5)';
end if;
    INSERT INTO weapon (weapon_type_id,rarity,weapon_name,weapon_details) VALUES (weapon_type_id,rarity,weapon_name,weapon_details);
END$$

DELIMITER ;

call insert_weapon(1,4,'测试1','测试1-1');
call insert_weapon(1,7,'错误测试2','错误测试2-1');

-- 圣遗物表存储过程
drop procedure if exists insert_artifacts;
DELIMITER $$
CREATE PROCEDURE insert_artifacts(        
    IN artifacts_name VARCHAR(255),    
		in set_bonus varchar(255)
)
BEGIN
    INSERT INTO artifacts (artifacts_name,set_bonus) VALUES (artifacts_name,set_bonus);
END$$

DELIMITER ;

call insert_artifacts('测试1','测试1');

# 等级更新限制

drop trigger if exists before_update_user;
DELIMITER $$
CREATE TRIGGER before_update_user
BEFORE UPDATE ON `user`
FOR EACH ROW
BEGIN
	IF new.user_level>90 OR new.user_level<0 THEN
		SIGNAL SQLSTATE '45000'SET MESSAGE_TEXT = '更新失败:用户等级不能大于90或小于0';
	END IF;
END$$
DELIMITER ;

-- 武器更新限制
drop trigger if exists before_update_weapon;
DELIMITER $$
CREATE TRIGGER before_update_weapon
BEFORE UPDATE ON `weapon`
FOR EACH ROW
BEGIN
		IF new.weapon_level>90 OR new.weapon_level<0 THEN
				-- 如果大于100,则抛出错误
				SIGNAL SQLSTATE '45000'
				SET MESSAGE_TEXT = '更新失败:武器等级不能大于90或小于0';
		END IF;
END$$
DELIMITER ;

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1865330.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

宿主机无法通过ip连接wsl2解决方案

文章目录 原因排查网络模式win11防火墙关闭wsl ubuntu防火墙 如果之前能连接现在连接不上可以参考该方案 原因排查 网络模式win11防火墙(win11新增了Hyper-V防火墙)wsl2 ubuntu防火墙 网络模式 wsl2的默认网络模式是NAT&#xff0c;建议修改为镜像模式。在C:\Users\<User…

深入探讨极限编程(XP):技术实践与频繁发布的艺术

目录 前言1. 极限编程的核心原则1.1 沟通1.2 简单1.3 反馈1.4 勇气1.5 尊重 2. 关键实践2.1 结对编程2.1.1 提高代码质量2.1.2 促进知识共享2.1.3 增强团队协作 2.2 测试驱动开发&#xff08;TDD&#xff09;2.2.1 提升代码可靠性2.2.2 提高代码可维护性2.2.3 鼓励良好设计 2.3…

Volatility 内存取证【信安比赛快速入门】

一、练习基本命令使用 1、获取镜像信息 ./volatility -f Challenge.raw imageinfo 一般取第一个就可以了 2、查看用户 ./volatility -f Challenge.raw --profileWin7SP1x64 printkey -K "SAM\Domains\Account\Users\Names" 3、获取主机名 ./volatility -f Challenge…

【学习】使用PyTorch训练与评估自己的ResNet网络教程

参考&#xff1a;保姆级使用PyTorch训练与评估自己的ResNet网络教程_训练自己的图像分类网络resnet101 pytorch-CSDN博客 项目地址&#xff1a;GitHub - Fafa-DL/Awesome-Backbones: Integrate deep learning models for image classification | Backbone learning/comparison…

Java医院绩效考核系统源码:考核目标、考核指标、考核方法、考核结果与奖惩措施

Java医院绩效考核系统源码&#xff1a;考核目标、考核指标、考核方法、考核结果与奖惩措施 随着我国医疗体制的改革广大人民群的看病难&#xff0c;看病贵的问题一直没有得到有效地解决医疗费用的上涨&#xff0c;远远大于大多数家庭收入的增长速度。医院的改革已经势在必行&am…

左右旋分辨

从端头看&#xff0c;切削路径顺时针是右旋&#xff0c;反时针左旋。

OpenCL在移动端GPU计算中的应用与实践

一、引言 移动端芯片性能的不断提升为在手机上进行计算密集型任务&#xff0c;如计算机图形学和深度学习模型推理&#xff0c;提供了可能。在Android设备上&#xff0c;GPU&#xff0c;尤其是高通Adreno和华为Mali&#xff0c;因其卓越的浮点运算能力&#xff0c;成为了异构计…

计算机SCI期刊,中科院3区,易录用,收稿广泛

一、期刊名称 The Journal of Supercomputing 二、期刊简介概况 期刊类型&#xff1a;SCI 学科领域&#xff1a;计算机科学 影响因子&#xff1a;3.3 中科院分区&#xff1a;3区 三、期刊征稿范围 《超级计算杂志》发表有关超级计算各个方面的技术、架构和系统、算法、语…

【PromptCC】遥感图像变化字幕的解耦范式

摘要 以往的方法忽略了任务的显著特异性&#xff1a;对于不变和变化的图像对&#xff0c;RSICC难度是不同的&#xff0c;以一种耦合的方式处理未变化和变化的图像对&#xff0c;这通常会导致变化字幕的混淆。论文链接&#xff1a;https://ieeexplore.ieee.org/stamp/stamp.jsp…

CircuitBreaker断路器-Resilience4j

目录 背景分布式架构面临的问题&#xff1a;服务雪崩如何解决&#xff1f; CircuitBreakerResilience4jCircuitBreaker 服务熔断服务降级三种状态转换例子参数配置案例demo作业 BulkHead隔离特性SemaphoreBulkhead使用了信号量FixedThreadPoolBulkhead使用了有界队列和固定大小…

非root用户crontab定时任务不执行

前言 有一个sh脚本&#xff0c;通过crontab -l写入后&#xff0c;发现并没有执行&#xff0c;手动执行脚本却正常&#xff0c;怀疑是权限上的问题。 排查 在/var/log/cron查看日志发现有" FAILED to authorize user with PAM (Module is unknown)"的报错 解决 …

基于阿里云 OpenAPI 插件,让 Grafana 轻松实现云上数据可视化

作者&#xff1a;徽泠 引言 Grafana 作为市场上领先的开源监控解决方案之一&#xff0c;使得数据监控和可视化变得触手可及。作为一款开源的数据可视化和分析软件&#xff0c;Grafana 支持查询、可视化、提醒和探索您的各种数据&#xff0c;无论它们存储在何处。Grafana 通过…

HTTP协议中的各种请求头、请求类型的作用以及用途

目录 一、http协议介绍二、http协议的请求头三、http协议的请求类型四、http协议中的各种请求头、请求类型的作用以及用途 一、http协议介绍 HTTP&#xff08;HyperText Transfer Protocol&#xff0c;超文本传输协议&#xff09;是一种用于分布式、协作式和超媒体信息系统的应…

兰州市红古区市场监管管理局调研食家巷品牌,关注细节,推动进步

近日&#xff0c;兰州市红古区市场监管管理局临平凉西北绿源电子商务有限公司进行了深入视察&#xff0c;为企业发展带来了关怀与指导。 食家巷品牌作为平凉地区特色美食的代表之一&#xff0c;一直以来凭借其纯手工工艺和独特的风味&#xff0c;在市场上占据了一席之地。领导…

0.7 模拟电视标准 PAL 简介

0.7 模拟电视标准PAL PAL 是一种用于模拟电视的彩色编码系统&#xff0c;全名为逐行倒相&#xff08;Phase Alternating Line&#xff09;。它是三大模拟彩色电视标准之一&#xff0c;另外两个标准是 NTSC 和 SECAM。“逐行倒相”的意思是每行扫描线的彩色信号会跟上一行倒相&…

读写内部闪存FLASH读取芯片ID

读写内部闪存FLASH 右下角是OLED&#xff0c;然后左上角在PB1和PB11两个引脚&#xff0c;插上两个按键用于控制。下一个代码读取芯片ID&#xff0c;这个也是接上一个OLED&#xff0c;能显示测试数据就可以了。 STM32-STLINK Utility 本节的代码调试&#xff0c;使用辅助软件…

什么是云服务器镜像,如何选择?

云服务器镜像是一种用于业务连续性、灾难恢复和备份的技术手段&#xff0c;其本质是云端创建的服务器数据副本。 这些镜像内容可以涵盖系统、光盘、软件、网站甚至整个服务器&#xff0c;主要用于创建容错和冗余服务器计算基础架构&#xff0c;为用户提供了一个方便且可靠的解…

银河麒麟桌面操作系统V10SP1【FTP服务器】配置手册

简介: FTP是一个文件传输协议,主要是在互联网上提供文件储存和访问服务的计算机,一个FTP服务器可以对多个客户端提供服务。本文主要介绍在银河麒麟桌面操作系统V10SP1上如何搭建FTP服务器以及在客户端如何访问FTP服务器的操作方法。 正文: 一、操作环境 服务端:银河麒…

推荐系统(LLM去偏?) | (WSDM24)预训练推荐系统:因果去偏视角

::: 大家好&#xff01;今天我分享的文章是来自威斯康星大学麦迪逊分校和亚马逊AWS AI实验室的最新工作&#xff0c;文章所属领域是推荐系统和因果推理&#xff0c;作者针对跨域推荐中的偏差问题提出了一种基于因果去偏的预训练推荐系统框架PreRec。 ::: 原文&#xff1a;Pre-t…

logstash配置文件中明文密码加密

1 案例背景 应用配置文件中禁止使用明文密码&#xff0c;需要加密处理 上图中&#xff0c;红框打码位置为es的明文密码&#xff0c;需要对其进行处理 2 创健keystore文件 /rpa/logstash/bin/logstash-keystore --path.settings /rpa/isa/conf/logstash/ create 注&#xff1…