Exemples :
CREATE TABLE Professeur (
prof_id INTEGER PRIMARY KEY,
prof_nom VARCHAR(30) NOT NULL,
prof_prenom VARCHAR(20) NOT NULL,
prof_tel CHAR(10),
prof_adresse VARCHAR(80),
prof_statut VARCHAR(10) NOT NULL
CHECK (prof_statut IN ('MCF', 'PU', 'PRAG', 'ATER'))
);
CREATE TABLE Diplome (
dip_id INT PRIMARY KEY,
dip_nom VARCHAR(10) NOT NULL,
dip_niveau CHAR(2) NOT NULL,
dip_discipline VARCHAR(15) NOT NULL,
prof_id INT NOT NULL,
FOREIGN KEY (prof_id) REFERENCES professeur(prof_id)
);
CREATE TABLE UE(
UE_num INT PRIMARY KEY,
UE_nom VARCHAR(20) NOT NULL,
UE_ECTS INT DEFAULT 5,
UE_CM INT,
UE_TD INT DEFAULT 0,
UE_TP INT,
dip_id INT NOT NULL,
FOREIGN KEY (dip_id) REFERENCES diplome(dip_id)
);
CREATE TABLE Etudiant (
etud_num INTEGER PRIMARY KEY ,
etud_nom VARCHAR(30) NOT NULL,
etud_prenom VARCHAR(20) NOT NULL,
etud_adresse VARCHAR(80) NOT NULL,
etud_naissance DATE,
dip_id INTEGER,
FOREIGN KEY dip_id REFERENCES diplome
);
CREATE TABLE Enseigne (
prof_id INTEGER REFERENCES professeur(prof_id),
UE_num INTEGER REFERENCES UE(UE_num),
PRIMARY KEY (prof_id, UE_num)
);