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