You are on page 1of 2

1) select nom , prenom from abonnee where num_abonnee in ou bien = any

(select num_abonnee from emprunter


where cote='C_433'
group by num_abonnee
having count(*)>10
order by count(*) desc)

2)select cote from emprunter


where num_abonnee='146'
group by cote
having count(*) >10
order by cont(*) desc

3)select nom , prenom from abonnee where num_abonnee in


(select num_abonnee from emprunter where date_emprunt =
(select max(date_emprunt) from emprunter)

4)select nom , prenom from abonnee where type ='�tudiant' and num_abonnee in

( select num_abonnee from emprunter where date_retour=null and sysdate -


date_emprunter>3 or date_retour -date_emprunter >3

5) ///////////////pour les questions 4 et 5 j'ai pas trouver la dur�e d'empreinte


dans les tableaux ???//////////

6)select nom , prenom from abonnee where num_abonnee in

(select num_abonnee,count(*) form emprunter group by num_abonnee having count(*)>=


all (select count(*) from emprunter group by num_abonnee) ////
(select max(count(*)) from emprunter group by num_abonnee)

7) select distinct num_abonnee from emprunter e where not exists (select cote from
livre l where not exists (select * from emprunter emp where emp.cote=l.cote and
emp.num_abonnee = e.num_abonnee))

select * from abonnee a where exists(select * from emprunter e where


e.num_abonne=a.num_abonne)

create or replace trigger verifMaj before insert on emprunter for each row

begin
if (:new.date_emprunt<sysdate) then
raise_application_error(-20001,'date emprunt erron�');
endif;

end verifMaj

create or replace trigger verifEmp before insert on emprunter


for each row

declare diff number ;

begin

if(:new.date_emprunt-sysdate<0) then
raise application error(-20001,'date emprunt erron�');
end if;
end verifEmp;

You might also like