id_student | id_sabject | value
SELECT
(SELECT COUNT(a.`id`) FROM `marks` AS a WHERE a.`value` IN ("Отлично")) AS `count_5`,
(SELECT COUNT(b.`id`) FROM `marks` AS b WHERE b.`value` IN ("Хорошо", "Отлично")) AS `count_4_5`,
(SELECT COUNT(c.`id`) FROM `marks` AS c WHERE c.`value` IN ("Удов.", "Хорошо", "Отлично")) AS `count_3_4_5`