Sort by

recency

|

5216 Discussions

|

  • + 0 comments

    select concat(concat(Name,'(',left(Occupation,1)),')') from occupations order by Name

    ;

    with cte as (select count(*) as occupation_count ,occupation from occupations group by occupation order by occupation_count asc ) select concat("There are a total of"," " ,occupation_count," ",lower(occupation),"s.") from cte

  • + 0 comments

    MySQL: select case when occupation = 'Doctor' then concat(name,'(D)') when occupation = 'Actor' then concat(name,'(A)') when occupation = 'Professor' then concat(name,'(P)') when occupation = 'Singer' then concat(name,'(S)') end from occupations order by name; select case when occupation = 'Doctor' then concat('There are a total of ',count(occupation),' ',lower(occupation),'s.') when occupation = 'Actor' then concat('There are a total of ',count(occupation),' ',lower(occupation),'s.') when occupation = 'Professor' then concat('There are a total of ',count(occupation),' ',lower(occupation),'s.') when occupation = 'Singer' then concat('There are a total of ',count(occupation),' ',lower(occupation),'s.') end from occupations group by occupation order by count(occupation),occupation;

  • + 0 comments

    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);

  • + 0 comments

    SELECT CONCAT(name,"(",LEFT(Occupation, 1),")") AS name_occupation 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);

  • + 1 comment

    this is one giving the rigth ans according to me but this one is not been accepted by compiler don't know why

    select name, concat('(',left(OCCUPATION,1), ')') from OCCUPATIONS order by 1;
    select concat('There are a total of ',count(occupation), ' ',occupation,'s.') from OCCUPATIONS
    group by occupation
    order by count(occupation);