· 8 years ago · May 31, 2018, 07:56 AM
1drop table if exists Utilisateur;
2drop table if exists Evaluation;
3drop table if exists Participe;
4drop table if exists Dessin;
5drop table if exists Concours;
6drop table if exists Jury;
7
8Create Table Utilisateur
9( numUtilisateur integer not null auto_increment,
10nom varchar(40) not null,
11prenom varchar(40) not null,
12adresse varchar(40) not null,
13login varchar(20) not null,
14motDePasse varchar(35) not null,
15primary key (numUtilisateur)) ;
16
17Create Table Evaluation
18(numUtilisateur INTEGER NOT NULL,
19numDessin INTEGER NOT NULL,
20dateEvaluation DATE,
21note TINYINT not null,
22commentaire varchar(40) not null,
23foreign key (numUtilisateur) references Utilisateur (numUtilisateur),
24foreign key (numDessin) references Dessin (numDessin));
25
26Create Table Participe
27( numConcours INTEGER NOT NULL,
28numUtilisateur INTEGER NOT NULL,
29foreign key (numConcours) references Concours (numConcours),
30foreign key (numUtilisateur) references Utilisateur (numUtilisateur));
31
32Create Table Dessin
33( numUtilisateur INTEGER NOT NULL,
34numConcours INTEGER NOT NULL,
35commentaire varchar (40) NOT NULL,
36numDessin integer not null auto_increment,
37foreign key (commentaire) references Evaluation (commentaire),
38classement SMALLINT not null,
39dateRemise DATE,
40leDessin varchar(40) not null,
41foreign key (numUtilisateur) references Utilisateur (numUtilisateur),
42foreign key (numConcours) references Concours (numConcours) ) ;
43
44Create Table Concours
45( numUtilisateur INTEGER NOT NULL,
46numConcours INTEGER NOT NULL auto_increment,
47description varchar(40) not null,
48dateDebut DATE,
49dateFin DATE,
50etat varchar(40) not null,
51foreign key (numUtilisateur) references Utilisateur (numUtilisateur)) ;
52
53Create Table Jury
54( numUtilisateur INTEGER NOT NULL,
55numConcours INTEGER NOT NULL,
56foreign key (numUtilisateur) references Utilisateur (numUtilisateur),
57foreign key (numConcours) references Concours (numConcours) ) ;