select count(*) from panier; -- R17 : afficher le nombre de panier pour chaque client select count(*),idcl from panier group by ....; -- R18: afficher le nombre de panier pour chaque client (idcl,nomcl,nbrepanier) select c.idcl,nomcl,count(*) as nbrepanier from panier p, client c where p.idcl=c.idcl group by c.idcl; --R19: afficher les clients ayant un certain nombre sup ou egal à 2 (idcl,nomcl,nbrepanier)
select c.idcl,nomcl,count(*) as nbrepanier
from panier p, client c where p.idcl=c.idcl group by c.idcl having count(*)>=2; -- R20: afficher les clients ayant le plus grand nombre de panier
select c.idcl,nomcl,count(*) as nbrepanier
from panier p, client c where p.idcl=c.idcl group by c.idcl,nomcl having count(*)=(select max(count(*)) from panier p, client c where p.idcl=c.idcl group by c.idcl,nomcl ); -- R21: le nombre de commande par mois -- R22 : calculer le montant de chaque panier (mnt=Somme (qte*pu))
-- R23 : afficher le dernier panier cree par un client donné -- R24 :afficher les anciens clients .Sont ceux dont leurs premiers paniers datent plus de 2 ans