Q18 updated

This commit is contained in:
Bonnet Ronan 2023-01-05 09:46:56 +01:00
parent 2d6364068e
commit b8b20ae87e

View file

@ -3,11 +3,11 @@
-- --------+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----+----+----+----+----+----+ -- --------+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----+----+----+----+----+----+
-- Axel | | | O | O | | | | | | | | O | O | | | | | | | | | -- Axel | | | O | O | | | | | | | | O | O | | | | | | | | |
-- --------+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----+----+----+----+----+----+ -- --------+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----+----+----+----+----+----+
-- Ronan | | O | | | | O | | | | O | | | | | | x | | | | | | -- Ronan | | O | | | | O | | | | O | | | | | | x | | O | | | |
-- --------+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----+----+----+----+----+----+ -- --------+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----+----+----+----+----+----+
-- Yasmine | | | | | O | | | O | | | | | | O | O | | | | O | | O | -- Yasmine | | | | | O | | | O | | | | | | O | O | | | | O | | O |
-- --------+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----+----+----+----+----+----+ -- --------+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----+----+----+----+----+----+
-- Nathan | O | | | | | | O | | O | | O | | | | | | O | O | | | | -- Nathan | O | | | | | | O | | O | | O | | | | | | O | | | | |
-- --------+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----+----+----+----+----+----+ -- --------+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----+----+----+----+----+----+
-- ^ ^ ^ -- ^ ^ ^
-- | | | -- | | |
@ -181,14 +181,14 @@ WHERE idScientifique IN (
WHERE nbProjets = 1 WHERE nbProjets = 1
); );
-- Nathan QUESTION 18 (celle de Ronan) tested -- Ronan QUESTION 18 tested
SELECT * from Scientifique SELECT * from Scientifique
WHERE idScientifique IN ( WHERE idScientifique IN (
SELECT idScientifique FROM ( SELECT idScientifique FROM (
SELECT idScientifique, COUNT(DISTINCT idProjet) AS nbProjets FROM Participe SELECT idScientifique, COUNT(DISTINCT idProjet) AS nbProjets FROM Participe
GROUP BY idScientifique GROUP BY idScientifique
) AS ParticipationCount ) AS ParticipationCount
RIGHT JOIN ( JOIN (
SELECT COUNT(DISTINCT idProjet) AS nbTotalProjets FROM Projet SELECT COUNT(DISTINCT idProjet) AS nbTotalProjets FROM Projet
) AS ProjectCount ) AS ProjectCount
ON ParticipationCount.nbProjets = ProjectCount.nbTotalProjets ON ParticipationCount.nbProjets = ProjectCount.nbTotalProjets