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
|
5216 Discussions
|
Please Login in order to post a comment
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
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;
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);
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);
this is one giving the rigth ans according to me but this one is not been accepted by compiler don't know why