|
|
|
|
1
|
---
|
|
|
|
|
1
|
+DROP TABLE IF EXISTS questions;
|
|
|
2
|
+DROP TABLE IF EXISTS reponses;
|
|
|
3
|
+DROP TABLE IF EXISTS categorie;
|
|
|
4
|
+DROP TABLE IF EXISTS scores;
|
2
|
|
5
|
|
3
|
-SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
|
|
4
|
-SET time_zone = "+00:00";
|
|
|
5
|
-
|
|
|
6
|
-
|
|
|
7
|
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
|
8
|
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
|
|
9
|
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
|
|
10
|
-/*!40101 SET NAMES utf8 */;
|
|
|
11
|
-
|
|
|
12
|
---
|
|
|
13
|
---
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
---
|
|
|
17
|
---
|
|
|
18
|
|
6
|
|
19
|
CREATE TABLE IF NOT EXISTS `categorie` (
|
7
|
CREATE TABLE IF NOT EXISTS `categorie` (
|
20
|
`nom_cat` varchar(30) NOT NULL
|
8
|
`nom_cat` varchar(30) NOT NULL
|
21
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
9
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
22
|
|
10
|
|
23
|
---
|
|
|
24
|
---
|
|
|
25
|
-
|
|
|
26
|
INSERT INTO `categorie` (`nom_cat`) VALUES
|
11
|
INSERT INTO `categorie` (`nom_cat`) VALUES
|
27
|
('Dessin Animés'),
|
12
|
('Dessin Animés'),
|
28
|
('ISEN'),
|
13
|
('ISEN'),
|
29
|
('Jeux Vidéos');
|
14
|
('Jeux Vidéos');
|
30
|
|
15
|
|
31
|
-
|
|
|
32
|
---
|
|
|
33
|
---
|
|
|
34
|
|
16
|
|
35
|
CREATE TABLE IF NOT EXISTS `questions` (
|
17
|
CREATE TABLE IF NOT EXISTS `questions` (
|
36
|
`intitule` varchar(150) NOT NULL,
|
18
|
`intitule` varchar(150) NOT NULL,
|
37
|
`num_reponse` tinyint(4) NOT NULL,
|
19
|
`num_reponse` tinyint(4) NOT NULL,
|
38
|
- `reponse1` varchar(50) NOT NULL DEFAULT '',
|
|
|
39
|
- `reponse2` varchar(50) NOT NULL DEFAULT ''
|
|
|
|
|
20
|
+ `reponse1` varchar(50) NOT NULL,
|
|
|
21
|
+ `reponse2` varchar(50) NOT NULL
|
40
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
22
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
41
|
|
23
|
|
42
|
---
|
|
|
43
|
---
|
|
|
44
|
-
|
|
|
45
|
INSERT INTO `questions` (`intitule`, `num_reponse`, `reponse1`, `reponse2`) VALUES
|
24
|
INSERT INTO `questions` (`intitule`, `num_reponse`, `reponse1`, `reponse2`) VALUES
|
46
|
('2 d''entre eux ont tapé ce texte', 2, 'Les CSI', 'Les CIR'),
|
25
|
('2 d''entre eux ont tapé ce texte', 2, 'Les CSI', 'Les CIR'),
|
47
|
('A été diffusée pendant les années 80', 0, 'Les Mystérieuses Cités d''Or', 'Les Tortues Ninjas'),
|
26
|
('A été diffusée pendant les années 80', 0, 'Les Mystérieuses Cités d''Or', 'Les Tortues Ninjas'),
|
48
|
('C''est un héros de Nintendo', 0, 'Mario', 'Link'),
|
27
|
('C''est un héros de Nintendo', 0, 'Mario', 'Link'),
|
49
|
('Elle est accompagnée d’animaux', 1, 'Gigi', 'Magical DoReMi'),
|
28
|
('Elle est accompagnée d’animaux', 1, 'Gigi', 'Magical DoReMi'),
|
50
|
('Elle possède une fée nommée Dodo', 2, 'Gigi', 'Magical DoReMi'),
|
29
|
('Elle possède une fée nommée Dodo', 2, 'Gigi', 'Magical DoReMi'),
|
51
|
-('Il à révé sur l'' île de Cocolint', 2, 'Mario', 'Link'),
|
|
|
|
|
30
|
+('Il a rêvé sur l''île de Cocolint', 2, 'Mario', 'Link'),
|
52
|
('Il protège le royaume champignon', 1, 'Mario', 'Link'),
|
31
|
('Il protège le royaume champignon', 1, 'Mario', 'Link'),
|
53
|
('Ils passent en colle', 1, 'Les CSI', 'Les CIR'),
|
32
|
('Ils passent en colle', 1, 'Les CSI', 'Les CIR'),
|
54
|
('Les clubs y sont situés', 1, 'Rez de chaussée', '1er étage'),
|
33
|
('Les clubs y sont situés', 1, 'Rez de chaussée', '1er étage'),
|
55
|
-('L’héroïne possède des pouvoirs magique', 0, 'Gigi', 'Magical DoReMi'),
|
|
|
|
|
34
|
+('L''héroïne possède des pouvoirs magique', 0, 'Gigi', 'Magical DoReMi'),
|
56
|
('On y affronte une tortue à trois tête', 1, 'A Link to the Past', 'Ocarina of Time'),
|
35
|
('On y affronte une tortue à trois tête', 1, 'A Link to the Past', 'Ocarina of Time'),
|
57
|
('On y aperçoit un bateau nommé Solaris', 1, 'Les Mystérieuses Cités d''Or', 'Les Tortues Ninjas'),
|
36
|
('On y aperçoit un bateau nommé Solaris', 1, 'Les Mystérieuses Cités d''Or', 'Les Tortues Ninjas'),
|
58
|
('On y combat des Skulltulas', 2, 'A Link to the Past', 'Ocarina of Time'),
|
37
|
('On y combat des Skulltulas', 2, 'A Link to the Past', 'Ocarina of Time'),
|
|
|
|
|
76
|
('Un certain Shreder y intervient', 2, 'Les Mystérieuses Cités d''Or', 'Les Tortues Ninjas'),
|
41
|
('Un certain Shreder y intervient', 2, 'Les Mystérieuses Cités d''Or', 'Les Tortues Ninjas'),
|
77
|
('Une salle consacrée aux devoir s''y situe', 2, 'Rez de chaussée', '1er étage');
|
42
|
('Une salle consacrée aux devoir s''y situe', 2, 'Rez de chaussée', '1er étage');
|
78
|
|
43
|
|
79
|
-
|
|
|
80
|
---
|
|
|
81
|
---
|
|
|
82
|
|
44
|
|
83
|
CREATE TABLE IF NOT EXISTS `reponses` (
|
45
|
CREATE TABLE IF NOT EXISTS `reponses` (
|
84
|
`reponse1` varchar(50) NOT NULL,
|
46
|
`reponse1` varchar(50) NOT NULL,
|
|
|
|
|
88
|
`nom_cat` varchar(30) NOT NULL
|
48
|
`nom_cat` varchar(30) NOT NULL
|
89
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
49
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
90
|
|
50
|
|
91
|
---
|
|
|
92
|
---
|
|
|
93
|
-
|
|
|
94
|
INSERT INTO `reponses` (`reponse1`, `reponse2`, `nom_cat`) VALUES
|
51
|
INSERT INTO `reponses` (`reponse1`, `reponse2`, `nom_cat`) VALUES
|
95
|
('Gigi', 'Magical DoReMi', 'Dessin Animés'),
|
52
|
('Gigi', 'Magical DoReMi', 'Dessin Animés'),
|
96
|
('Les Mystérieuses Cités d''Or', 'Les Tortues Ninjas', 'Dessin Animés'),
|
53
|
('Les Mystérieuses Cités d''Or', 'Les Tortues Ninjas', 'Dessin Animés'),
|
|
|
|
|
100
|
('A Link to the Past', 'Ocarina of Time', 'Jeux Vidéos'),
|
56
|
('A Link to the Past', 'Ocarina of Time', 'Jeux Vidéos'),
|
101
|
('Mario', 'Link', 'Jeux Vidéos');
|
57
|
('Mario', 'Link', 'Jeux Vidéos');
|
102
|
|
58
|
|
103
|
-
|
|
|
104
|
---
|
|
|
105
|
---
|
|
|
106
|
|
59
|
|
107
|
CREATE TABLE IF NOT EXISTS `scores` (
|
60
|
CREATE TABLE IF NOT EXISTS `scores` (
|
108
|
`login` varchar(20) NOT NULL,
|
61
|
`login` varchar(20) NOT NULL,
|
109
|
`score` int(11) NOT NULL
|
62
|
`score` int(11) NOT NULL
|
110
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
63
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
111
|
|
64
|
|
112
|
---
|
|
|
113
|
---
|
|
|
114
|
-
|
|
|
115
|
INSERT INTO `scores` (`login`, `score`) VALUES
|
65
|
INSERT INTO `scores` (`login`, `score`) VALUES
|
116
|
('azerty', 28),
|
66
|
('azerty', 28),
|
117
|
('David', 19),
|
67
|
('David', 19),
|
|
|
|
|
127
|
('Patrick', 24),
|
74
|
('Patrick', 24),
|
128
|
('Thomas', 33);
|
75
|
('Thomas', 33);
|
129
|
|
76
|
|
130
|
---
|
|
|
131
|
---
|
|
|
132
|
|
77
|
|
133
|
---
|
|
|
134
|
---
|
|
|
135
|
ALTER TABLE `categorie`
|
78
|
ALTER TABLE `categorie`
|
136
|
ADD PRIMARY KEY (`nom_cat`);
|
79
|
ADD PRIMARY KEY (`nom_cat`);
|
137
|
|
80
|
|
138
|
---
|
|
|
139
|
---
|
|
|
140
|
ALTER TABLE `questions`
|
81
|
ALTER TABLE `questions`
|
141
|
ADD PRIMARY KEY (`intitule`,`reponse1`,`reponse2`), ADD KEY `FK_Questions_reponse2` (`reponse2`), ADD KEY `FK_Questions_reponse1` (`reponse1`);
|
82
|
ADD PRIMARY KEY (`intitule`,`reponse1`,`reponse2`), ADD KEY `FK_Questions_reponse2` (`reponse2`), ADD KEY `FK_Questions_reponse1` (`reponse1`);
|
142
|
|
83
|
|
143
|
---
|
|
|
144
|
---
|
|
|
145
|
ALTER TABLE `reponses`
|
84
|
ALTER TABLE `reponses`
|
146
|
ADD PRIMARY KEY (`reponse1`,`reponse2`), ADD KEY `reponse2` (`reponse2`), ADD KEY `FK_Reponses_nom_cat` (`nom_cat`);
|
85
|
ADD PRIMARY KEY (`reponse1`,`reponse2`), ADD KEY `reponse2` (`reponse2`), ADD KEY `FK_Reponses_nom_cat` (`nom_cat`);
|
147
|
|
86
|
|
148
|
---
|
|
|
149
|
---
|
|
|
150
|
ALTER TABLE `scores`
|
87
|
ALTER TABLE `scores`
|
151
|
ADD PRIMARY KEY (`login`);
|
88
|
ADD PRIMARY KEY (`login`);
|
152
|
|
89
|
|
153
|
---
|
|
|
154
|
---
|
|
|
155
|
-
|
|
|
156
|
---
|
|
|
157
|
---
|
|
|
158
|
ALTER TABLE `questions`
|
90
|
ALTER TABLE `questions`
|
159
|
ADD CONSTRAINT `FK_Questions_reponse1` FOREIGN KEY (`reponse1`) REFERENCES `reponses` (`reponse1`) ON DELETE CASCADE ON UPDATE CASCADE,
|
91
|
ADD CONSTRAINT `FK_Questions_reponse1` FOREIGN KEY (`reponse1`) REFERENCES `reponses` (`reponse1`) ON DELETE CASCADE ON UPDATE CASCADE,
|
160
|
ADD CONSTRAINT `FK_Questions_reponse2` FOREIGN KEY (`reponse2`) REFERENCES `reponses` (`reponse2`) ON DELETE CASCADE ON UPDATE CASCADE;
|
92
|
ADD CONSTRAINT `FK_Questions_reponse2` FOREIGN KEY (`reponse2`) REFERENCES `reponses` (`reponse2`) ON DELETE CASCADE ON UPDATE CASCADE;
|
161
|
|
93
|
|
162
|
---
|
|
|
163
|
---
|
|
|
164
|
ALTER TABLE `reponses`
|
94
|
ALTER TABLE `reponses`
|
165
|
ADD CONSTRAINT `FK_Reponses_nom_cat` FOREIGN KEY (`nom_cat`) REFERENCES `categorie` (`nom_cat`) ON DELETE CASCADE ON UPDATE CASCADE;
|
95
|
ADD CONSTRAINT `FK_Reponses_nom_cat` FOREIGN KEY (`nom_cat`) REFERENCES `categorie` (`nom_cat`) ON DELETE CASCADE ON UPDATE CASCADE;
|
166
|
-
|
|
|
167
|
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
|
168
|
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
|
|
169
|
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
|