You are on page 1of 3

Rendu TP BDD

Nom: Boudali
Prénom: Sid Ahmed
Groupe 02
26/
Select nom from ELEVES where extract (year from
add_months(sysdate,4))-extract(year from date_naissance)>=24 ;
27/
Select nom , annee from ELEVES ORDER BY annee , nom;
28/
Select POINTS *5 from RESULTATS, ELEVES where
RESULTATS.num_eleve=ELEVES.num_eleve AND ELEVES.nom=’Tsuno’ ORDER
BY POINTS DESC;
29/
Select nom , avg(points) from ELEVES, RESULTATS where
ELEVES.num_eleve=RESULTATS.num_eleve and annee = 1 group by
ELEVES.NOM ;
30/
Select nom , avg(points) from ELEVES, RESULTATS where
ELEVES.num_eleve=RESULTATS.num_eleve and annee=1 group by
ELEVES.NOM HAVING SUM(points)>40;
31/
Select MAX(SUM(points)) from ELEVES, RESULTATS where
ELEVES.num_eleve=RESULTATS.num_eleve ;

37/
Select nom from PROFESSEURS where num_prof not in (select num_prof from
charge where PROFESSEURS.num_prof=charge.num_prof) and (num_cours=1);
34/
Select nom , poids from ELEVES where ELEVES.annee=1 AND poids > ALL (select
poids from ELEVES where ELEVES.annee=2);
33/
Select nom from ELEVES , RESULTATS where ELEVES.annee=1 and
ELEVES.num_eleve=RESULTATS.num_eleve group by nom HAVING avg
(points)>(select avg (points) from ELEVES , RESULTATS where
ELEVES.num_eleve = RESULTATS.num_eleve and ELEVES.annee = 1 );
35/
Select nom , poids from ELEVES where ELEVES.annee=1 AND poids > ANY
(select poids from ELEVES where ELEVES.annee=2);

36/
Select nom , poids, annee from ELEVES X group by nom,poids,annee HAVING
(poids)>(select avg (poids) from ELEVES Y where X.annee= Y.annee );
39/
select num_prof, nom from PROFESSEURS where not in (select * from cours
where annee = 2 and not exists (select * from charge
where PROFESSEURS.num_prof = CHARGE.num_prof and CHARGE.num_cours
= COURS.num_cours));
40/
Select um_eleve, nom from ELEVES where not in (select * from ACTIVITIES
where not in (select * from ACTIVITIES_PRATIQUES where ELEVES.num_eleve =
ACTIVITIES_PRATIQUES.num_eleve and ACTIVITIES_PRATIQUES.nom =
ACTIVITIES.nom));

You might also like