tp_bdd2/personnel.sql

124 lines
3.1 KiB
MySQL
Raw Normal View History

2022-12-07 08:31:53 +01:00
-- Axel
2022-11-30 16:13:35 +01:00
CREATE TABLE Personnel
2022-11-30 16:27:25 +01:00
(
2022-11-30 16:43:20 +01:00
idPersonnel INT CONSTRAINT UnePersonne PRIMARY KEY,
2022-12-07 08:24:08 +01:00
nom VARCHAR,
prenom VARCHAR,
2022-11-30 16:43:20 +01:00
date_de_naissance DATE,
2022-12-07 08:24:08 +01:00
adress VARCHAR,
2022-11-30 16:43:20 +01:00
date_de_recrutement DATE,
2022-11-30 16:27:25 +01:00
);
2022-11-30 16:22:37 +01:00
2022-12-07 08:31:53 +01:00
--Axel
2022-12-07 08:27:57 +01:00
CREATE TABLE Doctorant(
idDoctorant INT NOT NULL,
date_debut_these DATE,
date_soutenance DATE
FOREIGN KEY (idPersonnel) REFERENCES Personnel(idPersonnel),
PRIMARY KEY(idPersonnel)
);
2022-12-07 08:31:53 +01:00
--Yasmine
2022-11-30 16:43:20 +01:00
CREATE TABLE Scientifique(
idScientique INT NOT NULL,
idPersonnel INT NOT NULL,
grade CHAR,
2022-12-07 08:27:57 +01:00
FOREIGN KEY (idPersonnel) REFERENCES Personnel(idPersonnel),
2022-11-30 16:43:20 +01:00
PRIMARY KEY(idPersonnel)
2022-11-30 16:27:25 +01:00
);
2022-11-30 16:22:37 +01:00
2022-12-07 08:39:11 +01:00
CREATE TABLE Enseignant_Chercheur
2022-12-07 08:22:52 +01:00
-- Nathan
CREATE Auteur_Externe (
idAuteur INT NOT NULL,
nom VARCHAR,
prenom VARCHAR,
adresseMail VARCHAR,
idLabo INT NOT NULL,
FOREIGN KEY (idLabo) REFERENCES LaboExterne(idLabo),
PRIMARY KEY (idAuteur)
2022-12-07 08:24:38 +01:00
);
2022-12-07 08:24:08 +01:00
CREATE Labo_externe(
idLabo INT NOT NULL,
nom VARCHAR,
pays VARCHAR,
PRIMARY KEY(idLabo)
2022-12-07 08:22:52 +01:00
);
2022-11-30 16:48:39 +01:00
2022-12-07 08:22:52 +01:00
-- Nathan
CREATE Publication (
idPublication INT NOT NULL,
titre VARCHAR,
annee DATE,
nomConf VARCHAR,
classeConf VARCHAR,
nbPages INT,
PRIMARY KEY (idPublication)
2022-11-30 16:48:39 +01:00
);
2022-12-07 08:22:52 +01:00
-- Ronan
2022-11-30 16:36:19 +01:00
CREATE Participe(
idProjet INT NOT NULL,
idScientifique INT NOT NULL,
FOREIGN KEY (idProjet) REFERENCES Projet(idProjet),
2022-11-30 16:48:39 +01:00
FOREIGN KEY (idScientifique) REFERENCES Scientifique(idScientifique),
PRIMARY KEY (idProjet, idScientifique)
2022-11-30 16:36:19 +01:00
);
2022-12-07 08:22:52 +01:00
-- Ronan
2022-11-30 16:35:17 +01:00
CREATE Preside(
idCongres INT NOT NULL,
idScientifique INT NOT NULL,
FOREIGN KEY (idCongres) REFERENCES Congres(idCongres),
2022-11-30 16:48:39 +01:00
FOREIGN KEY (idScientifique) REFERENCES Scientifique(idScientifique),
PRIMARY KEY (idCongres, idScientifique)
2022-11-30 16:35:17 +01:00
);
2022-11-30 16:34:37 +01:00
2022-12-07 08:22:52 +01:00
-- Ronan
2022-11-30 16:34:37 +01:00
CREATE Publie_Scientifique(
idPublication INT NOT NULL,
idScientifique INT NOT NULL,
FOREIGN KEY (idPublication) REFERENCES Publication(idPublication),
2022-11-30 16:48:39 +01:00
FOREIGN KEY (idScientifique) REFERENCES Scientifique(idScientifique),
PRIMARY KEY (idPublication, idScientifique)
2022-11-30 16:34:37 +01:00
);
2022-12-07 08:22:52 +01:00
-- Ronan
2022-11-30 16:30:07 +01:00
CREATE Publie_Doctorant(
idPublication INT NOT NULL,
idDoctorant INT NOT NULL,
FOREIGN KEY (idPublication) REFERENCES Publication(idPublication),
2022-11-30 16:48:39 +01:00
FOREIGN KEY (idDoctorant) REFERENCES Doctorant(idDoctorant),
PRIMARY KEY (idPublication, idDoctorant)
2022-11-30 16:30:07 +01:00
);
2022-12-07 08:22:52 +01:00
-- Ronan
2022-11-30 16:28:38 +01:00
CREATE TABLE Publie_Externe(
idPublication INT NOT NULL,
idAuteurExterne INT NOT NULL,
2022-12-07 08:31:53 +01:00
s dFOREIGN KEY (idPublication) REFERENCES Publication(idPublication),
2022-11-30 16:48:39 +01:00
FOREIGN KEY (idAuteurExterne) REFERENCES Auteur_Externe(idAuteur),
PRIMARY KEY (idPublication, idAuteurExterne)
2022-11-30 16:28:38 +01:00
);
2022-11-30 16:22:37 +01:00
2022-12-07 08:22:52 +01:00
-- Ronan
2022-11-30 16:25:03 +01:00
CREATE TABLE Participe_Externe(
idProjet INT NOT NULL,
idPartenaire INT NOT NULL,
FOREIGN KEY (idProjet) REFERENCES Projet(idProjet),
2022-11-30 16:48:39 +01:00
FOREIGN KEY (idPartenaire) REFERENCES Partenaire(idPartenaire),
PRIMARY KEY (idProjet, idPartenaire)
2022-11-30 16:25:03 +01:00
);
2022-11-30 16:22:37 +01:00
2022-12-07 08:22:52 +01:00
-- Ronan
2022-11-30 16:22:37 +01:00
CREATE TABLE Organise (
idPortesOuverte INT NOT NULL,
2022-12-07 08:39:11 +01:00
idPersonnel INT NOT NULL,s d
2022-11-30 16:22:37 +01:00
FOREIGN KEY (idPortesOuverte) REFERENCES Journee_Portes_Ouvertes(idPorte_Ouverte),
FOREIGN KEY (idPersonnel) REFERENCES Personnel(idPersonnel),
PRIMARY KEY(idPortesOuverte, idPersonnel)
2022-11-30 16:48:39 +01:00
);