Based on your description in post #4, that’s not going to work unless both reviews are on the same record.
So essentially, you’re going to need to a select statement which returns something like this
project, reviewer1, rating1, reviewer2, rating2, number_of_students
Once you can get your data into that format, you would need to use a nested case, but you could do something like:
-- WARNING: Not tested. Review and test thoroughly!!!
SELECT project
, number_of_students
, CASE WHEN rating1 = 'G'
THEN CASE WHEN rating2 IN ('G', 'S') THEN 'G'
CASE WHEN rating2 = 'B' THEN 'S'
CASE WHEN rating2 = 'P' THEN 'B'
ELSE 'X' END
CASE WHEN rating1 = 'S'
THEN CASE WHEN rating2 = 'G' THEN 'G'
CASE WHEN rating2 IN ('S', 'B') THEN 'S'
ELSE 'X' END
CASE WHEN rating1 = 'B'
THEN CASE WHEN rating2 = 'G' THEN 'S'
CASE WHEN rating2 IN ('S', 'B') THEN 'B'
ELSE 'X' END
CASE WHEN rating1 = 'P'
THEN CASE WHEN rating2 = 'G' THEN 'B'
ELSE 'X' END
END AS GROUP_RATING
FROM student_project_evaluation
ORDER BY project, group_rating
OR, since you have almost an averaging system in place, a better idea might be to have a lookup table which has a numerical value to it where the group ratings can be found via some math in the joins. It’s an extra table lookup, but gets the ugliness of nested cases out of the way
rating pts grp_min_pts grp_max_pts
G 6 10 12
S 4 6 8
B 2 0 4
P 0 0 0
Then you could do it something like this
-- WARNING: Not tested. Review and test thoroughly!!!
SELECT project
, number_of_students
, COALESCE(group.rating, 'X') AS group_rating
FROM student_project_evaluation e
LEFT OUTER JOIN medal mr1 ON e.rating1 = mr1.rating
LEFT OUTER JOIN medal mr2 ON e.rating2 = mr2.rating
LEFT OUTER JOIN medal group ON (mr1.pts + mr2.pts) BETWEEN group.grp_min_pts AND group.grp_max_points
ORDER BY project, group_rating