Medium 1

 avatar
Manishyadav514
mysql
4 years ago
329 B
6
Indexable
-- Part 1, Alphabetically ordered name
SELECT CONCAT(name, '(', LEFT(occupation, 1),')') FROM OCCUPATIONS 
ORDER BY name;
-- Part 2, number of occurence
SELECT CONCAT('There are a total of ', COUNT(occupation), ' ', LOWER(occupation), 's.') 
FROM OCCUPATIONS 
GROUP BY occupation 
ORDER BY COUNT(occupation), occupation;
Editor is loading...