From 58595d2cb391aaf56e8e16cf5fc5e167dee0c98b Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Thu, 9 Oct 2025 12:25:58 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20des=20alias=20dans=20les=20requ?= =?UTF-8?q?=C3=AAtes=20SQL=20pour=20une=20meilleure=20lisibilit=C3=A9=20et?= =?UTF-8?q?=20coh=C3=A9rence=20dans=20TP3.sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- M2/SQL/{ => scripts}/DANJOU_Arthur.sql | 8 ++++---- M2/SQL/scripts/TP3.sql | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) rename M2/SQL/{ => scripts}/DANJOU_Arthur.sql (98%) diff --git a/M2/SQL/DANJOU_Arthur.sql b/M2/SQL/scripts/DANJOU_Arthur.sql similarity index 98% rename from M2/SQL/DANJOU_Arthur.sql rename to M2/SQL/scripts/DANJOU_Arthur.sql index 688c522..bb36f04 100644 --- a/M2/SQL/DANJOU_Arthur.sql +++ b/M2/SQL/scripts/DANJOU_Arthur.sql @@ -1,4 +1,4 @@ ---- EXERCICE 1 --- +-- EXERCICE 1 -- -- Suppression des tables si elles existent DROP TABLE IF EXISTS Inscription; @@ -73,7 +73,7 @@ INSERT INTO Inscription(IDIns, IDConf, IDOr, DateIns) VALUES (15, 5, 6, '2025-01 INSERT INTO Inscription(IDIns, IDConf, IDOr, DateIns) VALUES (16, 1, 6, '2025-01-10'); -- Question 1.1 -SELECT Titre, MIN(Prix) AS 'Prix Minimum' FROM Conference; +SELECT Titre, MIN(Prix) AS 'Prix Minimum' FROM Conference GROUP BY Titre; -- Question 1.2 SELECT c.Titre FROM Conference c @@ -117,10 +117,10 @@ SELECT o.NomOrateur FROM Orateur o WHERE NOT EXISTS ( SELECT * FROM Conference c WHERE NOT EXISTS ( SELECT * FROM Inscription i WHERE i.IDConf = c.IDConf AND o.IDOr = i.IDOr - ) AND C.DateConf = '2025-03-15' + ) AND c.DateConf = '2025-03-15' ); ---- EXERCICE 2 --- +-- EXERCICE 2 -- -- Suppression des tables si elles existent DROP TABLE IF EXISTS Oeuvre; diff --git a/M2/SQL/scripts/TP3.sql b/M2/SQL/scripts/TP3.sql index fb86333..1470cee 100644 --- a/M2/SQL/scripts/TP3.sql +++ b/M2/SQL/scripts/TP3.sql @@ -291,13 +291,13 @@ JOIN Participant act ON act.IdP = j.IdP WHERE act.Nom = 'Balasko' AND act.Prenom = 'Josiane'; -- Q3.6 -SELECT f.Titre, real.Nom, real.Prenom FROM Film f -JOIN Participant real ON F.Realisateur = real.IdP +SELECT f.Titre, rea.Nom, rea.Prenom FROM Film f +JOIN Participant rea ON f.Realisateur = rea.IdP WHERE f.Annee BETWEEN 1975 AND 1990; -- Q3.7 SELECT DISTINCT s.Nom FROM Salle s -JOIN Projection p on S.IdC = p.IdC +JOIN Projection p on s.IdC = p.IdC JOIN Film f ON f.IdF = p.IdF JOIN Joue j ON f.IdF = j.IdF JOIN Participant a ON a.IdP = j.IdP