Return to JUNTO

JUNTO Practice: The PADS

Discussed on August 15, 2019.

The PADS

Solutions

Click to see:

Oscar Martinez

SELECT
Name + "(" + SUBSTRING(Occupation,1,1) + ")" as name_occ
FROM
OCCUPATIONS
ORDER BY name_occ;
SELECT
"There are a total of ",
COUNT(*) as occ_count,
LOWER(Occupation) + "s."
FROM
OCCUPATIONS
GROUP BY Occupation
ORDER BY occ_count,Occupation;

John Lekberg

SELECT name || '(' || SUBSTR(occupation, 1, 1) || ')'
    FROM Occupations
ORDER BY name
;
  SELECT 'There are a total of ' || COUNT(*) || ' '
         || LOWER(occupation) || 's.'
    FROM Occupations
GROUP BY occupation
ORDER BY COUNT(*), occupation
;

Daniel Bassett

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;