|
@@ -1,116 +0,0 @@
|
1
|
|
---
|
2
|
|
-
|
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
|
|
-
|
19
|
|
-CREATE TABLE IF NOT EXISTS `categorie` (
|
20
|
|
- `nom_cat` varchar(30) NOT NULL
|
21
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
22
|
|
-
|
23
|
|
-
|
24
|
|
---
|
25
|
|
---
|
26
|
|
-
|
27
|
|
-CREATE TABLE IF NOT EXISTS `questions` (
|
28
|
|
- `intitule` varchar(150) NOT NULL,
|
29
|
|
- `num_reponse` tinyint(4) NOT NULL,
|
30
|
|
- `reponse1` varchar(50) NOT NULL DEFAULT '',
|
31
|
|
- `reponse2` varchar(50) NOT NULL DEFAULT ''
|
32
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
33
|
|
-
|
34
|
|
-
|
35
|
|
---
|
36
|
|
---
|
37
|
|
-
|
38
|
|
-CREATE TABLE IF NOT EXISTS `reponses` (
|
39
|
|
- `reponse1` varchar(50) NOT NULL,
|
40
|
|
- `reponse2` varchar(50) NOT NULL,
|
41
|
|
- `nom_cat` varchar(30) NOT NULL
|
42
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
43
|
|
-
|
44
|
|
-
|
45
|
|
---
|
46
|
|
---
|
47
|
|
-
|
48
|
|
-CREATE TABLE IF NOT EXISTS `scores` (
|
49
|
|
- `login` varchar(20) NOT NULL,
|
50
|
|
- `score` int(11) NOT NULL
|
51
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
52
|
|
-
|
53
|
|
---
|
54
|
|
---
|
55
|
|
-
|
56
|
|
---
|
57
|
|
---
|
58
|
|
-ALTER TABLE `categorie`
|
59
|
|
- ADD PRIMARY KEY (`nom_cat`);
|
60
|
|
-
|
61
|
|
---
|
62
|
|
---
|
63
|
|
-ALTER TABLE `questions`
|
64
|
|
- ADD PRIMARY KEY (`intitule`,`reponse1`,`reponse2`), ADD KEY `FK_Questions_reponse2` (`reponse2`), ADD KEY `FK_Questions_reponse1` (`reponse1`);
|
65
|
|
-
|
66
|
|
---
|
67
|
|
---
|
68
|
|
-ALTER TABLE `reponses`
|
69
|
|
- ADD PRIMARY KEY (`reponse1`,`reponse2`), ADD KEY `reponse2` (`reponse2`), ADD KEY `FK_Reponses_nom_cat` (`nom_cat`);
|
70
|
|
-
|
71
|
|
---
|
72
|
|
---
|
73
|
|
-ALTER TABLE `scores`
|
74
|
|
- ADD PRIMARY KEY (`login`);
|
75
|
|
-
|
76
|
|
---
|
77
|
|
---
|
78
|
|
-
|
79
|
|
---
|
80
|
|
---
|
81
|
|
-ALTER TABLE `questions`
|
82
|
|
-ADD CONSTRAINT `FK_Questions_reponse1` FOREIGN KEY (`reponse1`) REFERENCES `reponses` (`reponse1`) ON DELETE CASCADE ON UPDATE CASCADE,
|
83
|
|
-ADD CONSTRAINT `FK_Questions_reponse2` FOREIGN KEY (`reponse2`) REFERENCES `reponses` (`reponse2`) ON DELETE CASCADE ON UPDATE CASCADE;
|
84
|
|
-
|
85
|
|
---
|
86
|
|
---
|
87
|
|
-ALTER TABLE `reponses`
|
88
|
|
-ADD CONSTRAINT `FK_Reponses_nom_cat` FOREIGN KEY (`nom_cat`) REFERENCES `categorie` (`nom_cat`) ON DELETE CASCADE ON UPDATE CASCADE;
|
89
|
|
-
|
90
|
|
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
91
|
|
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
92
|
|
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|