Remember tables from "Coding time"? 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 /*Insert operator here/* (f.name,sb.name)
Which operator should we use, so the result set would look like this?