This repository was archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschemadata.sql
320 lines (254 loc) · 10 KB
/
schemadata.sql
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
-- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Lun 28 Mars 2011 à 21:37
-- Version du serveur: 5.5.8
-- Version de PHP: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Base de données: `ogre`
--
CREATE DATABASE `ogre` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `ogre`;
-- --------------------------------------------------------
--
-- Structure de la table `compensation_semestre`
--
CREATE TABLE IF NOT EXISTS `compensation_semestre` (
`id_semestre1` smallint(5) unsigned NOT NULL,
`id_semestre2` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`id_semestre1`,`id_semestre2`),
KEY `fk_semestre_has_semestre_semestre1` (`id_semestre1`),
KEY `fk_semestre_has_semestre_semestre2` (`id_semestre2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Contenu de la table `compensation_semestre`
--
-- --------------------------------------------------------
--
-- Structure de la table `epreuve`
--
CREATE TABLE IF NOT EXISTS `epreuve` (
`id_epreuve` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`id_ue` mediumint(8) unsigned NOT NULL,
`coeff` tinyint(4) NOT NULL,
`type_epreuve` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id_epreuve`),
KEY `fk_epreuve_ue1` (`id_ue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
--
-- Contenu de la table `epreuve`
--
-- --------------------------------------------------------
--
-- Structure de la table `etudiants`
--
CREATE TABLE IF NOT EXISTS `etudiants` (
`num_etudiant` mediumint(8) unsigned NOT NULL,
`nom` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`prenom` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`date_naissance` date DEFAULT NULL,
`nom_usuel` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`sexe` enum('F','M') COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`num_etudiant`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Contenu de la table `etudiants`
--
-- --------------------------------------------------------
--
-- Structure de la table `etudiants_semestre`
--
CREATE TABLE IF NOT EXISTS `etudiants_semestre` (
`num_etudiant` mediumint(8) unsigned NOT NULL,
`id_semestre` smallint(5) unsigned NOT NULL,
`statut` char(3) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`num_etudiant`,`id_semestre`),
KEY `fk_etudiants_has_semestre_etudiants1` (`num_etudiant`),
KEY `fk_etudiants_has_semestre_semestre1` (`id_semestre`),
KEY `fk_etudiants_semestre_statut_semestre1` (`statut`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Contenu de la table `etudiants_semestre`
--
-- --------------------------------------------------------
--
-- Structure de la table `formation`
--
CREATE TABLE IF NOT EXISTS `formation` (
`id_formation` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`code_formation` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`annee` char(9) COLLATE utf8_unicode_ci DEFAULT NULL,
`libelle` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id_formation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
--
-- Contenu de la table `formation`
--
INSERT INTO `formation` (`id_formation`, `code_formation`, `annee`, `libelle`) VALUES
(1, 'G1MAT', '2010-2011', 'Licence 1 Maths'),
(2, 'G1MAT', '2011-2012', 'Licence 1 Maths'),
(3, 'G1INF', '2010-2011', 'Licence 1 Informatique');
-- --------------------------------------------------------
--
-- Structure de la table `jlx_user`
--
CREATE TABLE IF NOT EXISTS `jlx_user` (
`usr_login` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`usr_password` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`usr_email` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`usr_login`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Contenu de la table `jlx_user`
--
INSERT INTO `jlx_user` (`usr_login`, `usr_password`, `usr_email`) VALUES
('user1', '3a5710ebc9e37a2cf339b8c584ccbe6bc0c2da06', ''),
('user2', 'e0707d7850a71a1bdcb58deb7469dd0eecde62dd', ''),
('user3', '0c85c05216680225ef7f08959d03e31b78dad5a6', '');
-- --------------------------------------------------------
--
-- Structure de la table `note`
--
CREATE TABLE IF NOT EXISTS `note` (
`id_note` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_epreuve` mediumint(8) unsigned NOT NULL,
`id_semestre` smallint(5) unsigned NOT NULL,
`num_etudiant` mediumint(8) unsigned NOT NULL,
`valeur` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`id_note`),
KEY `fk_note_epreuve1` (`id_epreuve`),
KEY `fk_note_semestre1` (`id_semestre`),
KEY `fk_note_etudiants1` (`num_etudiant`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
--
-- Contenu de la table `note`
--
-- --------------------------------------------------------
--
-- Structure de la table `semestre`
--
CREATE TABLE IF NOT EXISTS `semestre` (
`id_semestre` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`id_formation` smallint(5) unsigned NOT NULL,
`num_semestre` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id_semestre`),
KEY `fk_semestre_formation1` (`id_formation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;
--
-- Contenu de la table `semestre`
--
INSERT INTO `semestre` (`id_semestre`, `id_formation`, `num_semestre`) VALUES
(1, 1, '1'),
(2, 1, '2'),
(3, 2, '1'),
(4, 2, '2'),
(5, 3, '1'),
(6, 3, '2');
-- --------------------------------------------------------
--
-- Structure de la table `semestre_ue`
--
CREATE TABLE IF NOT EXISTS `semestre_ue` (
`id_ue` mediumint(8) unsigned NOT NULL,
`id_semestre` smallint(5) unsigned NOT NULL,
`optionelle` tinyint(1) NOT NULL,
PRIMARY KEY (`id_ue`,`id_semestre`),
KEY `fk_formation_has_ue_ue1` (`id_ue`),
KEY `fk_formation_has_ue_semestre1` (`id_semestre`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Contenu de la table `semestre_ue`
--
INSERT INTO `semestre_ue` (`id_ue`, `id_semestre`, `optionelle`) VALUES
(1, 1, 0),
(2, 1, 0),
(3, 2, 0),
(4, 1, 0),
(4, 2, 0),
(5, 1, 0),
(5, 2, 0);
-- --------------------------------------------------------
--
-- Structure de la table `statut_semestre`
--
CREATE TABLE IF NOT EXISTS `statut_semestre` (
`statut` char(3) COLLATE utf8_unicode_ci NOT NULL,
`libelle` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`statut`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Contenu de la table `statut_semestre`
--
INSERT INTO `statut_semestre` (`statut`, `libelle`) VALUES
('NOK', 'Non Valide'),
('OK', 'Valide');
-- --------------------------------------------------------
--
-- Structure de la table `ue`
--
CREATE TABLE IF NOT EXISTS `ue` (
`id_ue` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`formule` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`code_ue` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`coeff` tinyint(4) NOT NULL,
`credits` tinyint(4) NOT NULL,
`libelle` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
`last_version` tinyint(1) NOT NULL,
PRIMARY KEY (`id_ue`),
KEY `INDEX_code` (`code_ue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ;
--
-- Contenu de la table `ue`
--
INSERT INTO `ue` (`id_ue`, `formule`, `code_ue`, `coeff`, `credits`, `libelle`, `last_version`) VALUES
(1, NULL, 'G2MA1', 2, 2, 'Analyse et Algèbre 2', 1),
(2, NULL, 'G2MA3', 3, 3, 'Géometrie et Algèbre linéaire', 1),
(3, NULL, 'G2MA5', 2, 2, 'Algorithmique numérique', 1),
(4, NULL, 'ANG', 1, 1, 'Anglais', 1),
(5, NULL, 'TEC', 1, 1, 'Technique Expression Communica', 1);
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `compensation_semestre`
--
ALTER TABLE `compensation_semestre`
ADD CONSTRAINT `fk_semestre_has_semestre_semestre1` FOREIGN KEY (`id_semestre1`) REFERENCES `semestre` (`id_semestre`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_semestre_has_semestre_semestre2` FOREIGN KEY (`id_semestre2`) REFERENCES `semestre` (`id_semestre`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `epreuve`
--
ALTER TABLE `epreuve`
ADD CONSTRAINT `fk_epreuve_ue1` FOREIGN KEY (`id_ue`) REFERENCES `ue` (`id_ue`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `etudiants_semestre`
--
ALTER TABLE `etudiants_semestre`
ADD CONSTRAINT `fk_etudiants_has_semestre_etudiants1` FOREIGN KEY (`num_etudiant`) REFERENCES `etudiants` (`num_etudiant`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_etudiants_has_semestre_semestre1` FOREIGN KEY (`id_semestre`) REFERENCES `semestre` (`id_semestre`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_etudiants_semestre_statut_semestre1` FOREIGN KEY (`statut`) REFERENCES `statut_semestre` (`statut`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `note`
--
ALTER TABLE `note`
ADD CONSTRAINT `fk_note_epreuve1` FOREIGN KEY (`id_epreuve`) REFERENCES `epreuve` (`id_epreuve`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_note_semestre1` FOREIGN KEY (`id_semestre`) REFERENCES `semestre` (`id_semestre`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_note_etudiants1` FOREIGN KEY (`num_etudiant`) REFERENCES `etudiants` (`num_etudiant`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `semestre`
--
ALTER TABLE `semestre`
ADD CONSTRAINT `fk_semestre_formation1` FOREIGN KEY (`id_formation`) REFERENCES `formation` (`id_formation`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `semestre_ue`
--
ALTER TABLE `semestre_ue`
ADD CONSTRAINT `fk_formation_has_ue_ue1` FOREIGN KEY (`id_ue`) REFERENCES `ue` (`id_ue`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_formation_has_ue_semestre1` FOREIGN KEY (`id_semestre`) REFERENCES `semestre` (`id_semestre`) ON DELETE NO ACTION ON UPDATE NO ACTION;