From fc656b2c2cd02aa1a3f4b6f33a4e01a673ea02a7 Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Thu, 25 Sep 2025 09:43:30 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20nouvelles=20requ=C3=AAtes=20SQL=20?= =?UTF-8?q?pour=20les=20analyses=20de=20donn=C3=A9es=20dans=20TP1.sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- M2/SQL/scripts/TP1.sql | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/M2/SQL/scripts/TP1.sql b/M2/SQL/scripts/TP1.sql index fec8e44..a3d1f29 100644 --- a/M2/SQL/scripts/TP1.sql +++ b/M2/SQL/scripts/TP1.sql @@ -48,3 +48,24 @@ GROUP BY Ville, Enseigne HAVING NombreMagasins >= 2; -- Q1.4 +SELECT Enseigne, Ville, AVG(Chiffre) AS ChiffreMoyen +FROM Magasin +GROUP BY Enseigne, Ville; + +-- Q1.5 +SELECT Enseigne, m.Ville, AVG(Chiffre) AS ChiffreMoyen +FROM Magasin AS m +JOIN Localite AS l ON m.Ville = l.Ville +WHERE l.Population >= 80000 +GROUP BY Enseigne, m.Ville; + +-- Q1.6 +SELECT Enseigne, Ville, SUM(Chiffre) as ChiffreAffaire +FROM Magasin +GROUP BY Ville, Enseigne; + +-- Q1.7 +SELECT Enseigne, Ville, SUM(Chiffre) as ChiffreAffaire +FROM Magasin +GROUP BY Ville, Enseigne +HAVING ChiffreAffaire >= 1000000; \ No newline at end of file