Coding
Published on

Hackerrank - The PADS solution

Authors

Solution one:

SELECT CONCAT(NAME,'(',LEFT(OCCUPATION,1),')')
FROM OCCUPATIONS
ORDER BY NAME;

Solution two:

SELECT CONCAT("There are total ",COUNT(OCCUPATION)," ",LOWER(OCCUPATION),"s.")
FROM OCCUPATIONS
GROUP BY OCCUPATION
ORDER BY COUNT(OCCUPATION),
         OCCUPATION;