【sql】sql必知必会_01
数据:
/*
Navicat Premium Data Transfer Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 80013
Source Host : localhost:3306
Source Schema : wucai Target Server Type : MySQL
Target Server Version : 80013
File Encoding : 65001 Date: 03/07/2019 12:09:58
*/ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0; -- ----------------------------
-- Table structure for heros
-- ----------------------------
DROP TABLE IF EXISTS `heros`;
CREATE TABLE `heros` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`hp_max` float NULL DEFAULT NULL,
`hp_growth` float NULL DEFAULT NULL,
`hp_start` float NULL DEFAULT NULL,
`mp_max` float NULL DEFAULT NULL,
`mp_growth` float NULL DEFAULT NULL,
`mp_start` float NULL DEFAULT NULL,
`attack_max` float NULL DEFAULT NULL,
`attack_growth` float NULL DEFAULT NULL,
`attack_start` float NULL DEFAULT NULL,
`defense_max` float NULL DEFAULT NULL,
`defense_growth` float NULL DEFAULT NULL,
`defense_start` float NULL DEFAULT NULL,
`hp_5s_max` float NULL DEFAULT NULL,
`hp_5s_growth` float NULL DEFAULT NULL,
`hp_5s_start` float NULL DEFAULT NULL,
`mp_5s_max` float NULL DEFAULT NULL,
`mp_5s_growth` float NULL DEFAULT NULL,
`mp_5s_start` float NULL DEFAULT NULL,
`attack_speed_max` float NULL DEFAULT NULL,
`attack_range` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`role_main` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`role_assist` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`birthdate` date NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10069 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ----------------------------
-- Records of heros
-- ----------------------------
INSERT INTO `heros` VALUES (10000, '夏侯惇', 7350, 288.8, 3307, 1746, 94, 430, 321, 11.57, 159, 397, 21.14, 101, 98, 3.357, 51, 37, 1.571, 15, 0, '近战', '坦克', '战士', '2016-07-19');
INSERT INTO `heros` VALUES (10001, '钟无艳', 7000, 275, 3150, 1760, 95, 430, 318, 11, 164, 409, 22.07, 100, 92, 3.143, 48, 37, 1.571, 15, 0, '近战', '战士', '坦克', NULL);
INSERT INTO `heros` VALUES (10002, '张飞', 8341, 329.4, 3450, 100, 0, 100, 301, 10.57, 153, 504, 27.07, 125, 115, 4.143, 57, 5, 0, 5, 0, '近战', '坦克', '辅助', NULL);
INSERT INTO `heros` VALUES (10003, '牛魔', 8476, 352.8, 3537, 1926, 104, 470, 273, 8.357, 156, 394, 20.36, 109, 117, 4.214, 58, 42, 1.786, 17, 0, '近战', '坦克', '辅助', '2015-11-24');
INSERT INTO `heros` VALUES (10004, '吕布', 7344, 270, 3564, 0, 0, 0, 343, 12.36, 170, 390, 20.79, 99, 97, 3.071, 54, 0, 0, 0, 0, '近战', '战士', '坦克', '2015-12-22');
INSERT INTO `heros` VALUES (10005, '亚瑟', 8050, 316.3, 3622, 0, 0, 0, 346, 13, 164, 400, 21.57, 98, 106, 3.643, 55, 0, 0, 0, 0, '近战', '战士', '坦克', NULL);
INSERT INTO `heros` VALUES (10006, '芈月', 6164, 281.5, 3105, 100, 0, 100, 289, 9.786, 152, 361, 19.5, 88, 77, 2.357, 44, 0, 0, 0, 0, '远程', '法师', '坦克', '2015-12-08');
INSERT INTO `heros` VALUES (10007, '程咬金', 8611, 369.6, 3437, 0, 0, 0, 316, 11.07, 161, 504, 27.07, 125, 119, 4.429, 57, 0, 0, 0, 0, '近战', '坦克', '战士', NULL);
INSERT INTO `heros` VALUES (10008, '廉颇', 9328, 412.1, 3558, 1708, 92, 420, 286, 8.786, 163, 514, 27.29, 132, 128, 4.929, 59, 36, 1.5, 15, 0, '近战', '坦克', NULL, NULL);
INSERT INTO `heros` VALUES (10009, '东皇太一', 7669, 319.1, 3201, 1926, 104, 470, 286, 8.786, 163, 360, 18.64, 99, 106, 3.786, 53, 42, 1.786, 17, 0, '近战', '坦克', NULL, '2017-03-30');
INSERT INTO `heros` VALUES (10010, '庄周', 8149, 345.6, 3311, 1694, 91, 420, 297, 9.071, 170, 497, 24.79, 150, 113, 4.143, 55, 36, 1.5, 15, 0, '近战', '辅助', '坦克', NULL);
INSERT INTO `heros` VALUES (10011, '太乙真人', 6835, 242.3, 3443, 1680, 90, 420, 284, 9.286, 154, 396, 21.57, 94, 86, 2.643, 49, 35, 1.429, 15, 0, '近战', '辅助', '坦克', '2016-11-24');
INSERT INTO `heros` VALUES (10012, '白起', 8638, 366.3, 3510, 1666, 89, 420, 288, 9.286, 158, 430, 22.14, 120, 119, 4.357, 58, 34, 1.429, 14, 0, '近战', '坦克', NULL, NULL);
INSERT INTO `heros` VALUES (10013, '雅典娜', 6264, 243, 2862, 1732, 93, 430, 327, 11.79, 162, 418, 22.29, 106, 83, 2.786, 44, 36, 1.5, 15, 0, '近战', '战士', '坦克', NULL);
INSERT INTO `heros` VALUES (10014, '刘邦', 8073, 336, 3369, 1940, 105, 470, 302, 10.29, 158, 504, 27.07, 125, 117, 4.214, 58, 42, 1.786, 17, 0, '近战', '坦克', '辅助', '2016-04-26');
INSERT INTO `heros` VALUES (10015, '刘禅', 8581, 372.6, 3364, 1694, 91, 420, 295, 8.357, 178, 459, 22.86, 139, 118, 4.429, 56, 36, 1.5, 15, 0, '近战', '坦克', NULL, NULL);
INSERT INTO `heros` VALUES (10016, '墨子', 7176, 292.4, 3083, 1722, 93, 420, 328, 10.5, 181, 475, 26.64, 102, 100, 3.5, 51, 37, 1.571, 15, 0, '近战', '法师', '坦克', NULL);
INSERT INTO `heros` VALUES (10017, '项羽', 8057, 380.1, 3535, 1694, 91, 420, 306, 10.64, 157, 494, 26.5, 123, 121, 4.5, 58, 36, 1.5, 15, 0, '近战', '坦克', NULL, NULL);
INSERT INTO `heros` VALUES (10018, '关羽', 7107, 270.4, 3322, 10, 0, 10, 343, 12.36, 170, 386, 20.36, 101, 94, 3.071, 51, 0, 0, 0, 0, '近战', '战士', '坦克', '2016-06-28');
INSERT INTO `heros` VALUES (10019, '后羿', 5986, 200.3, 3182, 1784, 96, 440, 396, 16.79, 161, 336, 17.86, 86, 71, 2.143, 41, 38, 1.571, 16, 0, '远程', '射手', NULL, NULL);
INSERT INTO `heros` VALUES (10020, '马可波罗', 5584, 181.6, 3041, 200, 0, 200, 362, 13.36, 175, 344, 18.07, 91, 75, 2.071, 46, 50, 0, 50, 0, '远程', '射手', NULL, '2016-08-23');
INSERT INTO `heros` VALUES (10021, '鲁班七号', 5989, 184.9, 3401, 1756, 94, 440, 400, 16.14, 174, 323, 16.79, 88, 69, 1.929, 42, 36, 1.5, 15, 0, '远程', '射手', NULL, NULL);
INSERT INTO `heros` VALUES (10022, '李元芳', 5725, 194.1, 3007, 1770, 95, 440, 396, 16.79, 161, 340, 18.07, 87, 66, 2.071, 37, 37, 1.571, 15, 0, '远程', '射手', NULL, '2016-04-12');
INSERT INTO `heros` VALUES (10023, '孙尚香', 6014, 198.5, 3235, 1756, 94, 440, 411, 17.07, 172, 346, 18.36, 89, 69, 2.071, 40, 36, 1.5, 15, 0, '远程', '射手', NULL, NULL);
INSERT INTO `heros` VALUES (10024, '黄忠', 5898, 194.6, 3173, 1784, 96, 440, 403, 16.5, 172, 319, 16.29, 91, 68, 2.071, 39, 38, 1.571, 16, 0, '远程', '射手', NULL, NULL);
INSERT INTO `heros` VALUES (10025, '狄仁杰', 5710, 176.3, 3242, 1770, 95, 440, 376, 14.79, 169, 338, 17.36, 95, 66, 1.857, 40, 37, 1.571, 15, 0, '远程', '射手', NULL, NULL);
INSERT INTO `heros` VALUES (10026, '虞姬', 5669, 192.3, 2977, 1770, 95, 440, 407, 17.29, 165, 329, 17.5, 84, 63, 1.929, 36, 38, 1.571, 16, 0, '远程', '射手', NULL, '2016-05-24');
INSERT INTO `heros` VALUES (10027, '成吉思汗', 5799, 198, 3027, 1742, 93, 440, 394, 15, 184, 329, 16.79, 94, 66, 2.071, 37, 36, 1.5, 15, 0, '远程', '射手', NULL, '2016-09-27');
INSERT INTO `heros` VALUES (10028, '嬴政', 5471, 167.6, 3125, 1946, 104, 490, 309, 10.86, 157, 295, 14.57, 91, 70, 1.857, 44, 41, 1.714, 17, 0, '远程', '法师', NULL, NULL);
INSERT INTO `heros` VALUES (10029, '武则天', 5037, 155.5, 2860, 1988, 107, 490, 297, 8.857, 173, 348, 18.07, 95, 64, 1.714, 40, 43, 1.786, 18, 0, '远程', '法师', NULL, NULL);
INSERT INTO `heros` VALUES (10030, '露娜', 6612, 256.5, 3021, 1836, 99, 450, 335, 12.29, 163, 375, 19.5, 102, 99, 3.357, 52, 39, 1.643, 16, 0, '近战', '战士', '法师', NULL);
INSERT INTO `heros` VALUES (10031, '甄姬', 5584, 181.6, 3041, 2002, 108, 490, 296, 9.357, 165, 330, 17.36, 87, 71, 2, 43, 44, 1.857, 18, 0, '远程', '法师', NULL, NULL);
INSERT INTO `heros` VALUES (10032, '妲己', 5824, 185.4, 3229, 2016, 109, 490, 293, 8.786, 170, 326, 17.14, 86, 74, 2, 46, 44, 1.857, 18, 0, '远程', '法师', NULL, NULL);
INSERT INTO `heros` VALUES (10033, '干将莫邪', 5583, 171, 3189, 1946, 104, 490, 292, 9.5, 159, 323, 16.5, 92, 71, 1.857, 45, 41, 1.714, 17, 0, '远程', '法师', NULL, '2017-05-22');
INSERT INTO `heros` VALUES (10034, '姜子牙', 5399, 174.4, 2958, 2002, 108, 490, 317, 10.64, 168, 342, 16.86, 106, 69, 1.929, 42, 44, 1.857, 18, 0, '远程', '法师', '辅助', NULL);
INSERT INTO `heros` VALUES (10035, '王昭君', 5429, 167.6, 3083, 1960, 105, 490, 296, 9.357, 165, 305, 15.29, 91, 70, 1.857, 44, 41, 1.714, 17, 0, '远程', '法师', NULL, NULL);
INSERT INTO `heros` VALUES (10036, '诸葛亮', 5655, 180, 3135, 1988, 107, 490, 287, 9.357, 156, 330, 17.36, 87, 72, 2, 44, 43, 1.786, 18, 0, '远程', '法师', NULL, NULL);
INSERT INTO `heros` VALUES (10037, '不知火舞', 6014, 198.5, 3235, 200, 0, 200, 293, 8.786, 170, 336, 17.64, 89, 76, 2.143, 46, 50, 0, 50, 0, '近战', '法师', '刺客', '2016-05-12');
INSERT INTO `heros` VALUES (10038, '貂蝉', 5611, 185.1, 3019, 1960, 105, 490, 287, 8.571, 167, 330, 17.36, 87, 71, 2, 43, 41, 1.714, 17, 0, '近战', '法师', '刺客', '2015-12-15');
INSERT INTO `heros` VALUES (10039, '孙膑', 6811, 257.4, 3208, 1926, 104, 470, 328, 10.86, 176, 413, 22.5, 98, 85, 2.857, 45, 42, 1.786, 17, 0, '远程', '辅助', '法师', NULL);
INSERT INTO `heros` VALUES (10040, '安琪拉', 5994, 190.8, 3323, 1960, 105, 490, 293, 8.786, 170, 315, 16.57, 83, 76, 2.071, 47, 41, 1.714, 17, 0, '远程', '法师', NULL, NULL);
INSERT INTO `heros` VALUES (10041, '小乔', 5916, 202, 3088, 1988, 107, 490, 263, 7.857, 153, 309, 15.29, 95, 75, 2.214, 44, 43, 1.786, 18, 0, '远程', '法师', NULL, NULL);
INSERT INTO `heros` VALUES (10042, '周瑜', 5513, 172.9, 3093, 1974, 106, 490, 298, 9.857, 160, 320, 16.64, 87, 70, 1.857, 44, 42, 1.786, 17, 0, '远程', '法师', NULL, '2015-11-10');
INSERT INTO `heros` VALUES (10043, '张良', 5799, 198, 3027, 1988, 107, 490, 293, 8.786, 170, 320, 16.64, 87, 73, 2.143, 43, 43, 1.786, 18, 0, '远程', '法师', NULL, '2015-10-26');
INSERT INTO `heros` VALUES (10044, '高渐离', 6165, 217.4, 3122, 1988, 107, 490, 290, 9.071, 163, 343, 17.5, 98, 77, 2.357, 44, 42, 1.786, 17, 0, '远程', '法师', NULL, NULL);
INSERT INTO `heros` VALUES (10045, '扁鹊', 6703, 249.9, 3205, 2016, 109, 490, 309, 10.07, 168, 374, 20.5, 87, 83, 2.714, 45, 44, 1.857, 18, 0, '远程', '法师', '辅助', NULL);
INSERT INTO `heros` VALUES (10046, '钟馗', 6280, 204.3, 3420, 1988, 107, 490, 278, 8.286, 162, 390, 20.79, 99, 91, 2.429, 57, 42, 1.786, 17, 0, '近战', '法师', '战士', '2016-03-24');
INSERT INTO `heros` VALUES (10047, '大乔', 5399, 174.4, 2958, 1926, 104, 470, 305, 9.786, 168, 340, 17.64, 93, 69, 1.929, 42, 42, 1.786, 17, 0, '近战', '辅助', NULL, '2017-02-28');
INSERT INTO `heros` VALUES (10048, '鬼谷子', 7107, 270.4, 3322, 1808, 97, 450, 297, 9.643, 162, 394, 21.57, 92, 89, 3, 47, 38, 1.571, 16, 0, '近战', '辅助', NULL, '2017-06-29');
INSERT INTO `heros` VALUES (10049, '蔡文姬', 5910, 190.9, 3238, 1898, 102, 470, 292, 9.5, 159, 350, 18.14, 96, 66, 2, 38, 41, 1.714, 17, 0, '远程', '辅助', NULL, '2016-07-08');
INSERT INTO `heros` VALUES (10050, '花木兰', 5397, 179.4, 2886, 100, 0, 100, 362, 14, 166, 349, 18.79, 86, 72, 2, 44, 0, 0, 0, 0, '近战', '战士', '刺客', '2016-01-01');
INSERT INTO `heros` VALUES (10051, '赵云', 6732, 247.5, 3267, 1760, 95, 430, 380, 14.79, 173, 394, 22.14, 84, 89, 2.786, 50, 37, 1.571, 15, 0, '近战', '战士', '刺客', NULL);
INSERT INTO `heros` VALUES (10052, '橘石京', 7000, 275, 3150, 0, 0, 0, 347, 13, 165, 392, 21.14, 96, 92, 3.143, 48, 0, 0, 0, 0, '近战', '刺客', '战士', NULL);
INSERT INTO `heros` VALUES (10053, '李白', 5483, 179.6, 2968, 1808, 97, 450, 330, 11.5, 169, 358, 18.57, 98, 80, 2.214, 49, 38, 1.571, 16, 0, '近战', '刺客', '战士', '2016-03-01');
INSERT INTO `heros` VALUES (10054, '韩信', 5655, 190.5, 2988, 1704, 91, 430, 386, 15.29, 172, 323, 16.5, 92, 75, 2.143, 45, 36, 1.5, 15, 0, '近战', '刺客', '战士', NULL);
INSERT INTO `heros` VALUES (10055, '杨戬', 7420, 291.5, 3339, 1694, 91, 420, 325, 11.36, 166, 428, 23.57, 98, 98, 3.357, 51, 36, 1.5, 15, 0, '近战', '战士', NULL, '2016-10-11');
INSERT INTO `heros` VALUES (10056, '达摩', 7140, 280.5, 3213, 1694, 91, 420, 355, 13.14, 171, 415, 22.86, 95, 98, 3.357, 51, 36, 1.5, 15, 0, '近战', '战士', NULL, NULL);
INSERT INTO `heros` VALUES (10057, '孙悟空', 6585, 235.1, 3293, 1760, 95, 430, 349, 13, 167, 385, 20.79, 94, 87, 2.643, 50, 37, 1.571, 15, 0, '近战', '战士', '刺客', NULL);
INSERT INTO `heros` VALUES (10058, '刘备', 6900, 262.5, 3225, 1742, 93, 440, 363, 14.29, 163, 381, 19.14, 113, 79, 2.786, 40, 36, 1.5, 15, 0, '远程', '战士', NULL, '2016-02-02');
INSERT INTO `heros` VALUES (10059, '曹操', 7473, 286.1, 3467, 0, 0, 0, 361, 13.36, 174, 371, 19.07, 104, 101, 3.357, 54, 0, 0, 0, 0, '近战', '战士', NULL, NULL);
INSERT INTO `heros` VALUES (10060, '典韦', 7516, 291.6, 3434, 1774, 96, 430, 345, 12.64, 168, 402, 22.36, 89, 99, 3.357, 52, 39, 1.643, 16, 0, '近战', '战士', NULL, NULL);
INSERT INTO `heros` VALUES (10061, '宫本武藏', 6210, 236.3, 2902, 0, 0, 0, 330, 12.36, 157, 391, 20.36, 106, 85, 2.714, 47, 0, 0, 0, 0, '近战', '战士', NULL, '2015-10-30');
INSERT INTO `heros` VALUES (10062, '老夫子', 7155, 270.4, 3370, 5, 0, 5, 329, 11.5, 168, 409, 22.07, 100, 94, 3.071, 51, 0, 0, 0, 1, '近战', '战士', NULL, NULL);
INSERT INTO `heros` VALUES (10063, '哪吒', 7268, 270.4, 3483, 1808, 97, 450, 320, 11.5, 159, 408, 22.07, 99, 98, 3.214, 53, 38, 1.571, 16, 0, '近战', '战士', NULL, '2017-01-12');
INSERT INTO `heros` VALUES (10064, '阿轲', 5968, 192.8, 3269, 0, 0, 0, 427, 17.86, 177, 349, 18.57, 89, 81, 2.214, 50, 0, 0, 0, 0, '近战', '刺客', NULL, NULL);
INSERT INTO `heros` VALUES (10065, '娜可露露', 6205, 211.9, 3239, 1808, 97, 450, 385, 15.14, 173, 359, 19.5, 86, 79, 2.286, 47, 38, 1.571, 16, 0, '近战', '刺客', NULL, '2016-02-22');
INSERT INTO `heros` VALUES (10066, '兰陵王', 6232, 210, 3292, 1822, 98, 450, 388, 15.5, 171, 342, 18.36, 85, 99, 3.357, 52, 46, 1.929, 19, 0, '近战', '刺客', NULL, NULL);
INSERT INTO `heros` VALUES (10067, '铠', 6700, 237.5, 3375, 1784, 96, 440, 328, 10.86, 176, 388, 20.07, 107, 81, 2.643, 44, 38, 1.571, 16, 0, '近战', '战士', '坦克', NULL);
INSERT INTO `heros` VALUES (10068, '百里守约', 5611, 185.1, 3019, 1784, 96, 440, 410, 15.86, 188, 329, 16.79, 94, 68, 2.071, 39, 38, 1.571, 16, 0, '远程', '射手', '刺客', '2017-08-08'); SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 80013
Source Host : localhost:3306
Source Schema : wucai Target Server Type : MySQL
Target Server Version : 80013
File Encoding : 65001 Date: 18/04/2019 14:14:42
*/ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0; -- ----------------------------
-- Table structure for height_grades
-- ----------------------------
DROP TABLE IF EXISTS `height_grades`;
CREATE TABLE `height_grades` (
`height_level` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`height_lowest` float(3, 2) NOT NULL,
`height_highest` float(3, 2) NOT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ----------------------------
-- Records of height_grades
-- ----------------------------
INSERT INTO `height_grades` VALUES ('A', 2.00, 2.50);
INSERT INTO `height_grades` VALUES ('B', 1.90, 1.99);
INSERT INTO `height_grades` VALUES ('C', 1.80, 1.89);
INSERT INTO `height_grades` VALUES ('D', 1.60, 1.79); SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 80013
Source Host : localhost:3306
Source Schema : wucai Target Server Type : MySQL
Target Server Version : 80013
File Encoding : 65001 Date: 25/06/2019 23:46:41
*/ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0; -- ----------------------------
-- Table structure for player_score
-- ----------------------------
DROP TABLE IF EXISTS `player_score`;
CREATE TABLE `player_score` (
`game_id` int(11) NOT NULL,
`player_id` int(11) NOT NULL,
`is_first` tinyint(1) NOT NULL,
`playing_time` int(11) NOT NULL,
`rebound` int(11) NOT NULL,
`rebound_o` int(11) NOT NULL,
`rebound_d` int(11) NOT NULL,
`assist` int(11) NOT NULL,
`score` int(11) NOT NULL,
`steal` int(11) NOT NULL,
`blockshot` int(11) NOT NULL,
`fault` int(11) NOT NULL,
`foul` int(11) NOT NULL,
`shoot_attempts` int(11) NOT NULL,
`shoot_hits` int(11) NOT NULL,
`shoot_3_attempts` int(11) NOT NULL,
`shoot_3_hits` int(11) NOT NULL,
`shoot_p_attempts` int(11) NOT NULL,
`shoot_p_hits` int(11) NOT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ----------------------------
-- Records of player_score
-- ----------------------------
INSERT INTO `player_score` VALUES (10001, 10001, 1, 38, 4, 1, 3, 2, 26, 0, 1, 0, 3, 19, 10, 13, 4, 4, 2);
INSERT INTO `player_score` VALUES (10001, 10002, 1, 30, 6, 4, 2, 4, 22, 0, 0, 6, 3, 19, 8, 5, 1, 5, 5);
INSERT INTO `player_score` VALUES (10001, 10003, 1, 37, 17, 7, 10, 5, 18, 4, 0, 3, 4, 18, 8, 1, 0, 5, 2);
INSERT INTO `player_score` VALUES (10001, 10004, 1, 42, 6, 1, 5, 2, 14, 0, 4, 1, 2, 10, 4, 7, 4, 2, 2);
INSERT INTO `player_score` VALUES (10001, 10005, 1, 19, 2, 0, 2, 2, 0, 2, 0, 1, 1, 1, 0, 1, 0, 0, 0);
INSERT INTO `player_score` VALUES (10001, 10006, 0, 23, 2, 2, 0, 1, 9, 1, 0, 0, 2, 10, 3, 3, 2, 1, 1);
INSERT INTO `player_score` VALUES (10001, 10007, 0, 13, 1, 1, 0, 1, 7, 0, 0, 0, 2, 4, 2, 2, 1, 2, 2);
INSERT INTO `player_score` VALUES (10001, 10008, 0, 20, 2, 0, 2, 3, 6, 0, 0, 3, 3, 5, 3, 0, 0, 0, 0);
INSERT INTO `player_score` VALUES (10001, 10009, 0, 11, 1, 0, 1, 1, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0);
INSERT INTO `player_score` VALUES (10001, 10010, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0);
INSERT INTO `player_score` VALUES (10002, 10022, 1, 37, 7, 1, 6, 6, 19, 3, 0, 1, 3, 16, 7, 3, 1, 4, 4);
INSERT INTO `player_score` VALUES (10002, 10025, 1, 34, 9, 1, 8, 5, 19, 0, 0, 5, 1, 12, 8, 0, 0, 4, 3);
INSERT INTO `player_score` VALUES (10002, 10024, 1, 34, 6, 0, 6, 0, 17, 3, 5, 0, 2, 7, 5, 3, 2, 6, 5);
INSERT INTO `player_score` VALUES (10002, 10028, 1, 27, 3, 0, 3, 3, 13, 1, 1, 3, 1, 10, 4, 6, 4, 2, 1);
INSERT INTO `player_score` VALUES (10002, 10030, 1, 31, 1, 0, 1, 3, 4, 2, 0, 1, 2, 9, 2, 3, 0, 0, 0);
INSERT INTO `player_score` VALUES (10002, 10023, 0, 23, 12, 4, 8, 3, 18, 0, 0, 3, 6, 10, 8, 0, 0, 2, 2);
INSERT INTO `player_score` VALUES (10002, 10029, 0, 24, 2, 1, 1, 2, 11, 0, 0, 1, 2, 8, 5, 3, 1, 0, 0);
INSERT INTO `player_score` VALUES (10002, 10031, 0, 25, 1, 0, 1, 5, 10, 0, 1, 2, 3, 4, 3, 3, 2, 4, 2);
INSERT INTO `player_score` VALUES (10002, 10032, 0, 4, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0); SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 80013
Source Host : localhost:3306
Source Schema : wucai Target Server Type : MySQL
Target Server Version : 80013
File Encoding : 65001 Date: 18/04/2019 14:14:56
*/ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0; -- ----------------------------
-- Table structure for player
-- ----------------------------
DROP TABLE IF EXISTS `player`;
CREATE TABLE `player` (
`player_id` int(11) NOT NULL AUTO_INCREMENT,
`team_id` int(11) NOT NULL,
`player_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`height` float(3, 2) NULL DEFAULT NULL,
PRIMARY KEY (`player_id`) USING BTREE,
UNIQUE INDEX `player_name`(`player_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10038 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ----------------------------
-- Records of player
-- ----------------------------
INSERT INTO `player` VALUES (10001, 1001, '韦恩-艾灵顿', 1.93);
INSERT INTO `player` VALUES (10002, 1001, '雷吉-杰克逊', 1.91);
INSERT INTO `player` VALUES (10003, 1001, '安德烈-德拉蒙德', 2.11);
INSERT INTO `player` VALUES (10004, 1001, '索恩-马克', 2.16);
INSERT INTO `player` VALUES (10005, 1001, '布鲁斯-布朗', 1.96);
INSERT INTO `player` VALUES (10006, 1001, '兰斯顿-加洛韦', 1.88);
INSERT INTO `player` VALUES (10007, 1001, '格伦-罗宾逊三世', 1.98);
INSERT INTO `player` VALUES (10008, 1001, '伊斯梅尔-史密斯', 1.83);
INSERT INTO `player` VALUES (10009, 1001, '扎扎-帕楚里亚', 2.11);
INSERT INTO `player` VALUES (10010, 1001, '乔恩-洛伊尔', 2.08);
INSERT INTO `player` VALUES (10011, 1001, '布雷克-格里芬', 2.08);
INSERT INTO `player` VALUES (10012, 1001, '雷吉-巴洛克', 2.01);
INSERT INTO `player` VALUES (10013, 1001, '卢克-肯纳德', 1.96);
INSERT INTO `player` VALUES (10014, 1001, '斯坦利-约翰逊', 2.01);
INSERT INTO `player` VALUES (10015, 1001, '亨利-埃伦森', 2.11);
INSERT INTO `player` VALUES (10016, 1001, '凯里-托马斯', 1.91);
INSERT INTO `player` VALUES (10017, 1001, '何塞-卡尔德隆', 1.91);
INSERT INTO `player` VALUES (10018, 1001, '斯维亚托斯拉夫-米凯卢克', 2.03);
INSERT INTO `player` VALUES (10019, 1001, '扎克-洛夫顿', 1.93);
INSERT INTO `player` VALUES (10020, 1001, '卡林-卢卡斯', 1.85);
INSERT INTO `player` VALUES (10021, 1002, '维克多-奥拉迪波', 1.93);
INSERT INTO `player` VALUES (10022, 1002, '博扬-博格达诺维奇', 2.03);
INSERT INTO `player` VALUES (10023, 1002, '多曼塔斯-萨博尼斯', 2.11);
INSERT INTO `player` VALUES (10024, 1002, '迈尔斯-特纳', 2.11);
INSERT INTO `player` VALUES (10025, 1002, '赛迪斯-杨', 2.03);
INSERT INTO `player` VALUES (10026, 1002, '达伦-科里森', 1.83);
INSERT INTO `player` VALUES (10027, 1002, '韦斯利-马修斯', 1.96);
INSERT INTO `player` VALUES (10028, 1002, '泰瑞克-埃文斯', 1.98);
INSERT INTO `player` VALUES (10029, 1002, '道格-迈克德莫特', 2.03);
INSERT INTO `player` VALUES (10030, 1002, '科里-约瑟夫', 1.91);
INSERT INTO `player` VALUES (10031, 1002, '阿龙-霍勒迪', 1.85);
INSERT INTO `player` VALUES (10032, 1002, 'TJ-利夫', 2.08);
INSERT INTO `player` VALUES (10033, 1002, '凯尔-奥奎因', 2.08);
INSERT INTO `player` VALUES (10034, 1002, '埃德蒙-萨姆纳', 1.96);
INSERT INTO `player` VALUES (10035, 1002, '达文-里德', 1.98);
INSERT INTO `player` VALUES (10036, 1002, '阿利兹-约翰逊', 2.06);
INSERT INTO `player` VALUES (10037, 1002, 'Ike Anigbogu', 2.08); SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 80013
Source Host : localhost:3306
Source Schema : wucai Target Server Type : MySQL
Target Server Version : 80013
File Encoding : 65001 Date: 25/06/2019 23:46:15
*/ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0; -- ----------------------------
-- Table structure for team_score
-- ----------------------------
DROP TABLE IF EXISTS `team_score`;
CREATE TABLE `team_score` (
`game_id` int(11) NOT NULL,
`h_team_id` int(11) NOT NULL,
`v_team_id` int(11) NOT NULL,
`h_team_score` int(11) NOT NULL,
`v_team_score` int(11) NOT NULL,
`game_date` date NULL DEFAULT NULL,
PRIMARY KEY (`game_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ----------------------------
-- Records of team_score
-- ----------------------------
INSERT INTO `team_score` VALUES (10001, 1001, 1002, 102, 111, '2019-04-01');
INSERT INTO `team_score` VALUES (10002, 1002, 1003, 135, 134, '2019-04-10'); SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 80013
Source Host : localhost:3306
Source Schema : wucai Target Server Type : MySQL
Target Server Version : 80013
File Encoding : 65001 Date: 18/04/2019 14:15:06
*/ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0; -- ----------------------------
-- Table structure for team
-- ----------------------------
DROP TABLE IF EXISTS `team`;
CREATE TABLE `team` (
`team_id` int(11) NOT NULL,
`team_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
PRIMARY KEY (`team_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ----------------------------
-- Records of team
-- ----------------------------
INSERT INTO `team` VALUES (1001, '底特律活塞');
INSERT INTO `team` VALUES (1002, '印第安纳步行者');
INSERT INTO `team` VALUES (1003, '亚特兰大老鹰'); SET FOREIGN_KEY_CHECKS = 1;
chapter1 - chapter8 ...
#9-1 筛选最大生命值大于 6000 的英雄,按照主要定位进行分组,按照分组英雄数从高到低进行排序,并显示每个分组的英雄数量、主要定位和平均最大生命值。
SELECT
COUNT( * ) AS num,
role_main,
AVG(hp_max)
FROM
heros
WHERE
hp_max > 6000
GROUP BY
role_main
HAVING
num > 5
ORDER BY
num DESC;
#9-2 筛选最大生命值与最大法力值之和大于 7000 的英雄,按照攻击范围来进行分组,显示分组的英雄数量,以及分组英雄的最大生命值与法力值之和的平均值、最大值和最小值,并按照分组英雄数从高到低进行排序,其中聚集函数的结果包括小数点后两位。
SELECT
COUNT( * ) AS num,
ROUND( AVG( hp_max + mp_max ), 2 ),
ROUND( MAX( hp_max + mp_max ), 2 ),
ROUND( MIN( hp_max + mp_max ), 2 )
FROM
heros
WHERE
hp_max + mp_max > 7000
GROUP BY
attack_range
ORDER BY
num DESC;
#9-3 得到场均得分大于 20 的球员。场均得分从 player_score 表中获取,同时你需要输出球员的 ID、球员姓名以及所在球队的 ID 信息。
SELECT
player.player_id,
player.player_name,
player.team_id
FROM
player
WHERE
player.player_id IN (
SELECT
player_score.player_id
FROM
player_score
GROUP BY
player_score.player_id
HAVING
AVG( player_score.score ) > 20
);
【sql】sql必知必会_01的更多相关文章
- 读书笔记汇总 - SQL必知必会(第4版)
本系列记录并分享学习SQL的过程,主要内容为SQL的基础概念及练习过程. 书目信息 中文名:<SQL必知必会(第4版)> 英文名:<Sams Teach Yourself SQL i ...
- 读书笔记--SQL必知必会--建立练习环境
书目信息 中文名:<SQL必知必会(第4版)> 英文名:<Sams Teach Yourself SQL in 10 Minutes - Fourth Edition> MyS ...
- 读书笔记--SQL必知必会12--联结表
12.1 联结 联结(join),利用SQL的SELECT在数据查询的执行中联结表. 12.1.1 关系表 关系数据库中,关系表的设计是把信息分解成多个表,一类数据一个表,各表通过某些共同的值互相关联 ...
- 读书笔记--SQL必知必会18--视图
读书笔记--SQL必知必会18--视图 18.1 视图 视图是虚拟的表,只包含使用时动态检索数据的查询. 也就是说作为视图,它不包含任何列和数据,包含的是一个查询. 18.1.1 为什么使用视图 重用 ...
- 《SQL必知必会》学习笔记(一)
这两天看了<SQL必知必会>第四版这本书,并照着书上做了不少实验,也对以前的概念有得新的认识,也发现以前自己有得地方理解错了.我采用的数据库是SQL Server2012.数据库中有一张比 ...
- SQL 必知必会
本文介绍基本的 SQL 语句,包括查询.过滤.排序.分组.联结.视图.插入数据.创建操纵表等.入门系列,不足颇多,望诸君指点. 注意本文某些例子只能在特定的DBMS中实现(有的已标明,有的未标明),不 ...
- 0005 《SQL必知必会》笔记01-SELECT语句
1.SELECT基本语句: SELECT 字段名1,···,字段名n FROM 表名 2.检索所有字段,用"*"替换字段名,这会导致效率低下 SELECT * FROM 表名; 3 ...
- 你必知必会的SQL面试题
写在前面的话 本文参考原博<走向面试之数据库基础:一.你必知必会的SQL语句练习-Part 1>和<走向面试之数据库基础:一.你必知必会的SQL语句练习-Part 2>进行练习 ...
- 《SQL必知必会》学习笔记二)
<SQL必知必会>学习笔记(二) 咱们接着上一篇的内容继续.这一篇主要回顾子查询,联合查询,复制表这三类内容. 上一部分基本上都是简单的Select查询,即从单个数据库表中检索数据的单条语 ...
- 图灵程序设计丛书(SQL必知必会)笔记
SQL必知必会 第二课:检索数据 1.分页 (1).SQL Server 栗子 : select top 2 columns from tableName (2).Oracle 栗子 :select ...
随机推荐
- Centos中Python升级为3.X时yum出现except OSError, e: ^ SyntaxError: invalid syntax问题 No module named 'pip._internal.main
CentOS 7升级Python到3.7.2后,需要在/usr/bin/python创建了一个指向Python 3的软连接,然后将/usr/bin/yum的顶部的: !/usr/bin/python ...
- 纪中集训2020.02.05【NOIP提高组】模拟B 组总结反思——【佛山市选2010】组合数计算,生成字符串 PPMM
目录 JZOJ2290. [佛山市选2010]组合数计算 比赛时 之后 JZOJ2291. [佛山市选2010]生成字符串 比赛时 之后 JZOJ2292. PPMM 比赛时 之后 JZOJ2290. ...
- gulp常用插件之autoprefixer使用
更多gulp常用插件使用请访问:gulp常用插件汇总 autoprefixer这是一款自动管理浏览器前缀的插件,它可以解析CSS文件并且添加浏览器前缀到CSS内容里. 更多使用文档请点击访问autop ...
- Bootstrap4一些零散的知识点
·Bootstrap 是全球最受欢迎的前端组件库,用于开发响应式布局.移动设备优先的 WEB 项目. Bootstrap4 目前是 Bootstrap 的最新版本,是一套用于 HTML.CSS 和 J ...
- NSSM 将jar 安装成windows服务
1.下载 nssm (下载地址: http://www.nssm.cc/release/nssm-2.24.zip ) 2.将打包好的jar包放到一个文件夹中,编写run.bat文件,run.bat内 ...
- flex布局 居中
display:flex;justify-content: center;检查侧轴是否居中,比如古代竖着写字,检查字是否在每条竹简的中央. display:flex;align-items: cent ...
- 手写数字识别——利用keras高层API快速搭建并优化网络模型
在<手写数字识别——手动搭建全连接层>一文中,我们通过机器学习的基本公式构建出了一个网络模型,其实现过程毫无疑问是过于复杂了——不得不考虑诸如数据类型匹配.梯度计算.准确度的统计等问题,但 ...
- Vue中封装axios
参考: https://www.jianshu.com/p/7a9fbcbb1114 https://www.cnblogs.com/dreamcc/p/10752604.html 一.安装axios ...
- DVR
DVR,全称为Digital Video Recorder(硬盘录像机),即数字视频录像机,相对于传统的模拟视频录像机,采用硬盘录像,故常常被称为硬盘录像机.它是一套进行图像计算存储处理的计算机系统, ...
- Pycharm操作数据库
Pymysql 用于连接mysql数据库 连接数据库 data_ip = "192.168.34.128" data_name = "lch" data_pwd ...