We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
select
CASE
when occupation='Doctor' then CONCAT(name,'(D)')
when occupation='Professor' then CONCAT(name,'(P)')
when occupation='Singer' then CONCAT(name,'(S)')
else CONCAT(name,'(A)')
end as occ_nam
from OCCUPATIONS order by name asc;
select
CONCAT('There are a total of ',count(occupation),' ',LOWER(occupation),'s.') as ocurrences
from OCCUPATIONS group by occupation order by
count(occupation),occupation asc;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The PADS
You are viewing a single comment's thread. Return to all comments →
select CASE when occupation='Doctor' then CONCAT(name,'(D)') when occupation='Professor' then CONCAT(name,'(P)') when occupation='Singer' then CONCAT(name,'(S)') else CONCAT(name,'(A)') end as occ_nam from OCCUPATIONS order by name asc;
select CONCAT('There are a total of ',count(occupation),' ',LOWER(occupation),'s.') as ocurrences from OCCUPATIONS group by occupation order by count(occupation),occupation asc;