From 32ee2dad1779f92eb4dc902804fe99fbe95a4d6d Mon Sep 17 00:00:00 2001 From: Bonnet Ronan Date: Fri, 9 Dec 2022 12:10:40 +0100 Subject: [PATCH] fix q10 --- request.sql | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/request.sql b/request.sql index 8a092cf..8c5fd3b 100644 --- a/request.sql +++ b/request.sql @@ -68,10 +68,12 @@ WHERE idPersonnel IN ( ); -- Ronan Q10 -SELECT idDoctorant, nom, prenom, COUNT(*) FROM Encadrement -JOIN Scientifique on idPersonnel=idScientifique -GROUP BY idDoctorant, nom, prenom -HAVING COUNT(DISTINCT idScientifique)=1; +SELECT e.idDoctorant, nom, prenom, COUNT(*) FROM Encadrement e +JOIN Scientifique s ON e.idScientifique=s.idScientifique +JOIN Doctorant d ON e.idDoctorant=d.idDoctorant +RIGHT JOIN Personnel p ON d.idDoctorant=p.idPersonnel +GROUP BY e.idDoctorant, nom, prenom +HAVING COUNT(DISTINCT s.idScientifique)=1; -- Ronan Q16 SELECT pays, COUNT(*) nb_publi