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
|
go
create table etudiant
(mat char (10)primary key,
nom char (20)not null,
prénom char (20),
datenaiss datetime,
unique (nom,prénom))
go
create table cours
(ccode char(10) primary key,
cnom char(20),
enseignant char(20),
dimplome char(10))
go
create table examen
(ccode char (10),
mat char (10),
note int default 0 check (value between 0 and 20),
edate datetime,
primary key (ccode,mat)),
INDEX (mat),
FOREIGN KEY (mat),
REFERENCES etudiant(mat),
INDEX (ccode),
FOREIGN KEY (ccode),
REFERENCES examen(ccode)
) |
Partager