Look at the code below:
SELECT
coalesce(f.name, 'All faculties') as faculty,
coalesce(sb.name, 'All subjects') as subject,
AVG(m.mark) as mark
FROM mark m
INNER JOIN students s on s.id=m.student_id
INNER JOIN faculty_name f on f.id=s.faculty_id
INNER JOIN subject_type sb on sb.id=m.subject_id
GROUP BY CUBE (f.name,sb.name)
Select combination by which average "mark" is grouped in the result set.