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.
- Prepare
- SQL
- Advanced Select
- The PADS
- Discussions
The PADS
The PADS
Sort by
recency
|
5524 Discussions
|
Please Login in order to post a comment
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;
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;
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;
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 ;
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;