1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
| START TRANSACTION;
DROP DATABASE IF EXISTS db_hattrick;
CREATE DATABASE db_hattrick
DEFAULT CHARACTER SET utf8mb4
DEFAULT COLLATE utf8mb4_0900_as_cs;
USE db_hattrick;
CREATE TABLE t_player(
plr_id INT PRIMARY KEY,
plr_name VARCHAR(30) NOT NULL,
plr_fname VARCHAR(30) NOT NULL,
plr_dob DATE
) ENGINE=InnoDB;
CREATE TABLE t_skill_set(
sks_id INT PRIMARY KEY AUTO_INCREMENT,
sks_keeper INT NOT NULL,
sks_defending INT NOT NULL,
sks_playmaking INT NOT NULL,
sks_winger INT NOT NULL,
sks_passing INT NOT NULL,
sks_scoring INT NOT NULL,
sks_set_pieces INT NOT NULL
) ENGINE=InnoDB;
CREATE TABLE t_record(
rec_id INT PRIMARY KEY AUTO_INCREMENT,
rec_datetime DATETIME NOT NULL
) ENGINE=InnoDB;
CREATE TABLE t_condition(
cdn_id INT PRIMARY KEY AUTO_INCREMENT,
cdn_tsi INT NOT NULL,
cdn_form INT NOT NULL,
cdn_stamina INT NOT NULL
) ENGINE=InnoDB;
CREATE TABLE t_history(
fk_rec_id INT NOT NULL,
fk_plr_id INT NOT NULL,
fk_sks_id INT NOT NULL,
fk_cdn_id INT NOT NULL,
PRIMARY KEY (fk_plr_id, fk_rec_id),
FOREIGN KEY (fk_rec_id) REFERENCES t_record(rec_id),
FOREIGN KEY (fk_plr_id) REFERENCES t_player(plr_id),
FOREIGN KEY (fk_sks_id) REFERENCES t_skill_set(sks_id),
FOREIGN KEY (fk_cdn_id) REFERENCES t_condition(cdn_id)
) ENGINE=InnoDB;
INSERT INTO t_player(plr_id, plr_name, plr_fname, plr_dob)
VALUES
(452461647, 'Boé', 'Adrien', '1993-01-29'),
(452461644, 'Noël', 'Alban', '1996-12-28'),
(452461643, 'Lemercier', 'Alexis', '1992-01-01'),
(452461637, 'Gaultier', 'Bastien', '1997-02-01'),
(445480514, 'Schweiger', 'Gérald', '1998-12-21'),
(452461629, 'Ramassamy', 'Clément', '1978-01-11'),
(452461633, 'Bos', 'Jean-Baptiste', '2000-11-28')
;
INSERT INTO t_condition(cdn_tsi, cdn_form, cdn_stamina)
VALUES
# Adrien Boé
(880, 5, 5), (1010, 7, 5), (950, 6, 5), (960, 6, 5), (980, 6, 5), (1030, 6, 5), (1040, 6, 5),
(1040, 6, 5), (990, 6, 5), (970, 6, 5), (840, 6, 5), (1010, 7, 5), (880, 5, 5), (760, 4, 5),
(920, 5, 5), (1020, 6, 5), (910, 5, 5),
# Alban Noël
(2220, 6, 6), (2670, 7, 6), (2800, 7, 6), (2870, 7, 6), (2970, 7, 6), (3100, 7, 6), (3320, 7, 6),
(3400, 7, 6), (3630, 7, 6), (3440, 6, 6), (3630, 6, 6), (3800, 7, 6), (3860, 6, 6), (4520, 7, 6),
(4880, 7, 6), (4410, 6, 6), (4070, 5, 6),
# Alexis Lemercier
(1360, 5, 7), (2500, 8, 7), (2650, 6, 7), (2720, 6, 7), (2850, 7, 7), (3020, 7, 7), (3050, 7, 7),
(3110, 7, 7), (2780, 7, 7), (2960, 7, 7), (2970, 7, 7), (3060, 7, 7), (3080, 7, 7), (3220, 7, 7),
(3510, 7, 7), (3510, 7, 7), (3560, 7, 7),
# Bastien Gaultier
(710, 5, 6), (830, 6, 6), (1300, 7, 6), (1400, 7, 6), (1520, 6, 6), (1670, 6, 6), (1850, 6, 6),
(1890, 6, 6), (1960, 5, 6), (2010, 6, 6), (2030, 6, 6), (1690, 4, 6), (1610, 3, 6), (2620, 5, 6),
(2940, 6, 6), (3430, 6, 6), (3900, 7, 6),
# Gérald Schweiger
(4390, 7, 8), (3820, 5, 8), (3450, 4, 8),
# Clément Ramassami
(0, 3, 4), (0, 3, 2), (0, 3, 1), (0, 3, 1), (0, 3, 1), (0, 2, 1), (0, 2, 1),
(0, 2, 1), (0, 2, 1), (0, 3, 1), (0, 4, 1), (0, 4, 1), (0, 4, 1), (0, 4, 1),
(0, 3, 1), (0, 2, 1), (0, 4, 1),
# Jean-Baptiste Bos
(1070, 7, 7), (2150, 6, 7), (2440, 5, 7), (2370, 5, 7), (2570, 6, 7), (2590, 6, 6), (2440, 6, 6),
(2330, 5, 6), (2320, 5, 6), (2270, 5, 6), (2460, 6, 6), (2010, 4, 6)
;
INSERT INTO t_skill_set(sks_keeper, sks_defending, sks_playmaking, sks_winger, sks_passing, sks_scoring, sks_set_pieces)
VALUES
(1, 3, 4, 4, 6, 6, 3),
(1, 5, 6, 7, 6, 3, 5), (1, 5, 7, 7, 6, 3, 5), (1, 5, 8, 7, 6, 3, 5),
(1, 6, 6, 6, 4, 3, 3), (1, 7, 6, 6, 4, 3, 3), (1, 7, 7, 6, 4, 3, 3),
(1, 5, 6, 4, 5, 1, 4), (1, 5, 7, 4, 5, 1, 4), (1, 5, 8, 4, 5, 1, 4), (1, 5, 9, 4, 5, 1, 4),
(1, 2, 5, 5, 4, 8, 4),
(1, 1, 2, 1, 1, 2, 3), (1, 1, 1, 1, 0, 1, 3), (0, 0, 0, 0, 0, 0, 2), (0, 0, 0, 0, 0, 0, 1),
(1, 7, 4, 3, 5, 3, 6), (1, 8, 4, 3, 5, 3, 6), (1, 9, 4, 3, 5, 3, 6)
;
INSERT INTO t_record(rec_datetime)
VALUES
('2020-07-21 11:22:47'),
('2020-07-28 09:45:54'),
('2020-08-06 16:38:10'),
('2020-08-07 06:54:47'),
('2020-08-14 08:48:24'),
('2020-08-21 10:44:50'),
('2020-08-28 09:42:36'),
('2020-09-07 09:37:15'),
('2020-09-11 09:35:02'),
('2020-09-19 10:30:40'),
('2020-09-25 14:15:11'),
('2020-10-02 09:29:35'),
('2020-10-09 09:28:40'),
('2020-10-23 09:14:02'),
('2020-10-30 10:28:42'),
('2020-11-06 09:28:27'),
('2020-11-13 09:35:02')
;
INSERT INTO t_history(fk_rec_id, fk_plr_id, fk_sks_id, fk_cdn_id)
VALUES
# Adrien Boé
(1, 452461647, 1, 1), (2, 452461647, 1, 2), (3, 452461647, 1, 3), (4, 452461647, 1, 4), (5, 452461647, 1, 5),
(6, 452461647, 1, 6), (7, 452461647, 1, 7), (8, 452461647, 1, 8), (9, 452461647, 1, 9), (10, 452461647, 1, 10),
(11, 452461647, 1, 11), (12, 452461647, 1, 12), (13, 452461647, 1, 13), (14, 452461647, 1, 14), (15, 452461647, 1, 15),
(16, 452461647, 1, 16), (17, 452461647, 1, 17),
# Alban Noël
(1, 452461644, 2, 18), (2, 452461644, 2, 19), (3, 452461644, 2, 20), (4, 452461644, 2, 21), (5, 452461644, 2, 22),
(6, 452461644, 2, 23), (7, 452461644, 3, 24), (8, 452461644, 3, 25), (9, 452461644, 3, 26), (10, 452461644, 3, 27),
(11, 452461644, 3, 28), (12, 452461644, 3, 29), (13, 452461644, 3, 30), (14, 452461644, 3, 31), (15, 452461644, 4, 32),
(16, 452461644, 4, 33), (17, 452461644, 4, 34),
# Alexis Lemercier
(1, 452461643, 5, 35), (2, 452461643, 6, 36), (3, 452461643, 6, 37), (4, 452461643, 6, 38), (5, 452461643, 6, 39),
(6, 452461643, 6, 40), (7, 452461643, 6, 41), (8, 452461643, 6, 42), (9, 452461643, 6, 43), (10, 452461643, 7, 44),
(11, 452461643, 7, 45), (12, 452461643, 7, 46), (13, 452461643, 7, 47), (14, 452461643, 7, 48), (15, 452461643, 7, 49),
(16, 452461643, 7, 50), (17, 452461643, 7, 51),
# Bastien Gaultier
(1, 452461637, 8, 52), (2, 452461637, 8, 53), (3, 452461637, 9, 54), (4, 452461637, 9, 55), (5, 452461637, 9, 56),
(6, 452461637, 9, 57), (7, 452461637, 9, 58), (8, 452461637, 9, 59), (9, 452461637, 10, 60), (10, 452461637, 10, 61),
(11, 452461637, 10, 62), (12, 452461637, 10, 63), (13, 452461637, 10, 64), (14, 452461637, 10, 65), (15, 452461637, 10, 66),
(16, 452461637, 11, 67), (17, 452461637, 11, 68),
# Gérald Schweiger
(15, 445480514, 12, 69), (16, 445480514, 12, 70), (17, 445480514, 12, 71),
# Clément Ramassamy
(1, 452461629, 13, 72), (2, 452461629, 14, 73), (3, 452461629, 15, 74), (4, 452461629, 15, 75), (5, 452461629, 15, 76),
(6, 452461629, 15, 77), (7, 452461629, 15, 78), (8, 452461629, 15, 79), (9, 452461629, 15, 80), (10, 452461629, 15, 81),
(11, 452461629, 15, 82), (12, 452461629, 15, 83), (13, 452461629, 15, 84), (14, 452461629, 16, 85), (15, 452461629, 16, 86),
(16, 452461629, 16, 87), (17, 452461629, 16, 88),
# Jean-Baptiste Bos
(1, 452461633, 17, 89), (2, 452461633, 18, 90), (3, 452461633, 19, 91), (4, 452461633, 19, 92), (5, 452461633, 19, 93),
(6, 452461633, 19, 94), (7, 452461633, 19, 95), (8, 452461633, 19, 96), (9, 452461633, 19, 97), (10, 452461633, 19, 98),
(11, 452461633, 19, 99), (12, 452461633, 19, 100)
;
COMMIT; |
Partager