Méthode 1
SELECT nom, MAX(note), MIN(note)
FROM Notes N, Matières M
WHERE N.codM = M.code
GROUP BY code
ORDER BY AVG(note) DESC
Méthode 2
SELECT nom, MAX(note), MIN(note)
FROM Notes N
JOIN Matières M ON N.codM = M.code
GROUP BY code
ORDER BY AVG(note) DESC
Q5
SELECT COUNT(DISTINCT numC)
FROM Notes
WHERE note < 5
Q6
Méthode 1
SELECT numéro, C.nom, prénom, SUM (note * coeff) AS total
FROM Notes N, Matières M, Candidats C
WHERE N.numC = C.numéro AND M.code = N.codM AND numC NOT IN (SELECT numC
FROM Notes WHERE note < 5)
GROUP BY numéro
HAVING total > 1000
ORDER BY total DESC
Méthode 2
SELECT numéro, C.nom, prénom, SUM (note * coeff) AS total
FROM Notes N