alter table classe add primary key (id_classe);
alter table enseignant add primary key (id_enseignant);
alter table etudiant add primary key (id_etudiant);
alter table inscription add primary key (id_inscription);
alter table matiere add primary key (id_matiere);
alter table note add primary key (id_note);
alter table etudiant add constraint un_email_et unique(email);
alter table enseignant add constraint un_email_ens unique(email);
alter table etudiant add constraint fk_et_classe foreign key etudiant(id_classe) references classe(id_classe) on delete set null;
alter table matiere add constraint fk_mat_ensei foreign key matiere(id_enseignant) references enseignant(id_enseignant) on delete cascade;
alter table inscription add constraint fk_inscription_etudiant foreign key inscription(id_etudiant) references etudiant(id_etudiant) on delete cascade;
alter table note add constraint fk_note_etudiant foreign key note(id_etudiant) references etudiant(id_etudiant);
alter table note add constraint fk_note_mat foreign key note(id_matiere) references matiere(id_matiere);
alter table note add constraint ck_valeur_0_20 check(valeur between 0 and 20);
alter table etudiant add column(telephone varchar(20));
alter table matiere modify column coefficient smallint;
rename table classe to groupe_classe
;
alter table matiere
rename column nom_matiere to intitule
;
alter table enseignant drop column specialite;
alter table note drop constraint fk_note_mat;
alter table enseignant drop index un_email_ens;
drop table inscription;
-- your code goes here