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
| CREATE TABLE PE_personne(
PE_ident INT IDENTITY,
PE_matricule CHAR(8) NOT NULL,
PE_nom VARCHAR(50) NOT NULL,
PE_prenom VARCHAR(50) NOT NULL,
PE_ddn DATE NOT NULL,
PRIMARY KEY(PE_ident),
UNIQUE(PE_matricule)
);
CREATE TABLE EQ_equipe(
EQ_ident INT IDENTITY,
EQ_code CHAR(5) NOT NULL,
EQ_designation VARCHAR(50) NOT NULL,
PRIMARY KEY(EQ_ident),
UNIQUE(EQ_code)
);
CREATE TABLE IN_integrer(
PE_ident INT,
CA_date DATE,
EQ_ident INT NOT NULL,
PRIMARY KEY(PE_ident, CA_date),
FOREIGN KEY(PE_ident) REFERENCES PE_personne(PE_ident),
FOREIGN KEY(CA_date) REFERENCES CA_calendrier(CA_date),
FOREIGN KEY(EQ_ident) REFERENCES EQ_equipe(EQ_ident)
);
CREATE TABLE DI_diriger(
EQ_ident INT,
CA_date DATE,
Di_dtfin DATE NOT NULL,
PE_ident INT NOT NULL,
PRIMARY KEY(EQ_ident, CA_date),
FOREIGN KEY(EQ_ident) REFERENCES EQ_equipe(EQ_ident),
FOREIGN KEY(CA_date) REFERENCES CA_calendrier(CA_date),
FOREIGN KEY(PE_ident) REFERENCES PE_personne(PE_ident)
); |
Partager