Is there a way of nesting case when statements when one has multiple conditions. For example below, where num_students = 2, there are many diff classes. Thus the else statement for num_of students =2 is 'Stu_2, but for the overall data is 'unk'
select id, test_a, test_b,
case when num_students = 5 then 'Stu_5'
when num_students = 4 then 'Stu_4'
when num_students = 3 then 'Stu_3'
when num_students = 2 and class = 'Eng' then 'Stu_Eng_2'
when num_students =2 and class = 'Fre' then 'Stu_Fre_2'
when num_students = 2 and class = 'His' then 'Stu_His_2'
when num_students =2 and class = 'Geo' then 'Stu_Geo_2'
else 'Stu_2'
else 'unk'
from table