Anda di halaman 1dari 2

Exercice 1.

Exercice 2.
E1(c1,p1)
E2(c2,p2)
A1(#c1,#c2,a)
E3(#c1,p3)
E4(#c1,p4)
A2(#c2,#c1)

Exercice 3.
1.
a. create table evaluation(
numEtud int,
numCours varchar(10),
note number(2,2),
constraint pk_evaluation primary
key(numEtud,numCours),
constraint fk_eval_numEtud foeign key(numEtud)
references etudiant,
constraint fk_eval_numCours foeign key(numCours)
references cours
);
b. La difficulté est dans le choix de l’ordre d’insertion : il faut
commencer par insérer les informations relatives aux étudiants, aux cours
avant d’insérer les informations sur les évaluations :
insert into etudiant values (12,’Dupont’,null,2012) ;
insert into cours values(13,’Gestion Financière’,null) ;
insert into evaluation values(12,13,15) ;

2.
a. select e.numEtud,nomEtud
from etudiant e,evaluation ev
where e.numEtud = ev.numEtud
and numCours =’B6’ ;
b. select numEtud,nomEtud
from etudiant
where numEtud not in (
select numEtud
from evaluation
);
c. select nomCours
from etudiant e,evaluation ev, cours c
where e.numEtud = ev.numEtud
and ev.numCours = c.numCours
and NomEtud =’Durand’ ;

d.select nomEtud,avg(note)
from etudiant e,evaluation ev, cours c
where e.numEtud = ev.numEtud
and ev.numCours = c.numCours
and c.numCours between 100 and 300
group by (nomEtud) ;

e. select nomCours,avg(note)
from cours c,evaluation e
where c.numCours = e.numCours
group by(nomCours) ;

Anda mungkin juga menyukai