After grouping the data by school and student, you need to then run it through a PIVOT
on the count of Students with each number of subjects, to get the histogram 'bins':
SELECT [School], [0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11]
FROM
(
SELECT School, Student, COUNT([Subject]) AS Subjects
FROM Student_GCSE
GROUP BY School, Student
) x
PIVOT
(
COUNT(Student)
FOR Subjects IN ([0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11])
) y;
I've assumed a finite number of subjects, but you can derive the columns as well using dynamic sql