Medium 1
Manishyadav514
mysql
4 years ago
329 B
11
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...