728x90

출처 : https://www.hackerrank.com/challenges/the-pads/problem?isFullScreen=true" target="_blank" rel="noopener" data-mce-href="http:// https://www.hackerrank.com/challenges/the-pads/problem?isFullScreen=true">http:// https://www.hackerrank.com/challenges/the-pads/problem?isFullScreen=true 

 

The PADS | HackerRank

Query the name and abbreviated occupation for each person in OCCUPATIONS.

www.hackerrank.com

 

SELECT
    CONCAT (
        name
        , '(' 
        , SUBSTR(occupation, 1, 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

 

+ Recent posts