• + 0 comments

    select (case when occupation = 'Doctor' then name +'(D)' when occupation = 'Actor' then name +'(A)' when occupation = 'Singer' then name +'(S)' when occupation = 'Professor' then name +'(P)' end ) from occupations order by name;

    select ('There are a total of '+convert(varchar(4),count())+' '+ lower(occupation)+'s.') from occupations group by occupation order by count() , occupation