Sort by

recency

|

5524 Discussions

|

  • + 0 comments

    select Name||'('|| substr(Occupation,1, 1) ||')' from OCCUPATIONS;

    select 'There are a total of ' || count(Occupation) ||' ' || lower(Occupation) || 's.' from OCCUPATIONS group by Occupation order by count(Occupation), case lower(Occupation) when 'doctor' then 1 when 'singer' then 2 when 'actor' then 3 when 'professor' then 4 end;

  • + 0 comments

    SELECT CONCAT(Name,"(",LEFT(Occupation,1),")") FROM OCCUPATIONS ORDER BY Name ASC; SELECT CONCAT("There are a total of ",COUNT(Name)," ",lower(Occupation),"s.") FROM OCCUPATIONS GROUP BY Occupation Order By COUNT(Name) ASC, lower(Occupation) ASC;

  • + 0 comments

    SELECT CONCAT(Name,"(",LEFT(Occupation,1),")") FROM OCCUPATIONS ORDER BY Name ASC; SELECT CONCAT("There are a total of ", count(OCCUPATION), " ", LOWER(OCCUPATION), "s.") FROM OCCUPATIONS GROUP BY OCCUPATION ORDER BY COUNT(OCCUPATION) ASC;

  • + 0 comments

    MySQL Solution

    select concat(name,'(',left(occupation,1),')') from occupations order by name;

    select concat('There are a total of ',count(occupation),' ',lower(occupation),'s','.') from occupations group by occupation order by count(occupation),occupation ;

  • + 4 comments

    I don't know why this is wrong. the logic is correct and the result return what are expected, but hackerrank says wrong answer.

    Am I joke to you??

    SELECT CONCAT(NAME, " (", LEFT(OCCUPATION, 1), ")") FROM OCCUPATIONS ORDER BY NAME ASC; SELECT CONCAT("There are a total of ", count(OCCUPATION), " ", LOWER(OCCUPATION), "s.") FROM OCCUPATIONS GROUP BY OCCUPATION ORDER BY COUNT(OCCUPATION), OCCUPATION ASC;