The question asks me to show the number of students with averages greater than 7, less than 7 or equal to 7 for some tables that I have here. Showing this way:
How to create this column of Description ?
Returns the average of the values in a group. Null values are ignored.
As you did not give details, I assume that your SQL
will be something like:
SELECT CASE
WHEN AVG(NOTA) > 7 THEN 'Superior a 7'
WHEN AVG(NOTA) = 7 THEN 'Igual a 7'
ELSE ' Inferior a 7'
END 'Desrição',
COUNT(*) Quantidade
FROM ALUNO
GROUP BY CLASSE