Académique Documents
Professionnel Documents
Culture Documents
1. determiner les clients qui ont passé des commandes durant l'année 2020
2. determiner les clients qui n'ont pas passé des commandes durant l'année 2020
2.
minus
select code_client from commande where date_cde between '01/01/2020' and '21/12/2020';
where code_client NOT IN ( select code_client from commande where date_cde between
'01/01/2020' and '21/12/2020');
3.
minus
4.
5.
where a.code_art=d.code_art
group by num_cde;
where a.code_art=d.code_art
group by num_cde;
6.
1.select listecolonnes[,fonctions] 5
2.from listetables 1
3.[where condition] 2
4.[group by listecolonnes] 3
5.[having condition] 4
where a.code_art=d.code_art
group by num_cde
having sum(qte_cde*prix)>2500;
7.
where a.code_art=d.code_art
group by num_cde) S1
where a.code_art=d.code_art
where a.code_art=d.code_art
group by num_cde);
where a.code_art=d.code_art
group by num_cde
where a.code_art=d.code_art
group by num_cde
limit 1);
requêtes imbriquée
select listecolonnes
from listetables
where ...))
sous requete multiligne : operateur SQL in, not in, exists, not exists, any et all
where a.code_art=d.code_art
group by num_cde
where a.code_art=d.code_art
group by num_cde
);
where a.code_art=d.code_art
group by num_cde
where a.code_art=d.code_art
group by num_cde);
8.
detail_cde dc
group by num_cde;
9.
select sum(qte_cde*prix) CA
where a.code_art=d.code_art
and c.num_cde=d.num_cde
10.
detail_cde dc
group by num_cde
/************************************/