-
The PADS<HackerRank> 2023. 7. 10. 21:45728x90
The PADS
-- DB2
SELECT (name || '(' || SUBSTR(occupation,1,1) || ')')
FROM occupations
ORDER BY name;
SELECT ('There are a total of ' || COUNT(occupation) || ' ' || LOWER(occupation) || 's' || '.')
FROM occupations
GROUP BY occupation
ORDER BY COUNT(occupation), occupation ASC;
-- MYSQL
SELECT CONCAT(Name, '(', (SUBSTRING(Occupation, 1, 1)), ')')
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) ASC;
-- ORACLE
SELECT NAME || '(' || SUBSTR(OCCUPATION, 1,1) || ')'
FROM OCCUPATIONS
ORDER BY NAME ASC;
SELECT 'There are a total of ' || COUNT(OCCUPATION) || ' ' || LOWER(occupation) || 's.' FROM OCCUPATIONS
GROUP BY OCCUPATION
ORDER BY COUNT(NAME), OCCUPATION ASC;
-- MSSQL SERVER
SELECT CONCAT(Name, '(', (SUBSTRING(Occupation, 1, 1)), ')')
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) ASC;728x90'<HackerRank>' 카테고리의 다른 글
Weather Observation Station 19 (0) 2023.07.19 Weather Observation Station 18 (0) 2023.07.17 NEW Companies (0) 2023.07.14 Binary Tree Nodes (0) 2023.07.12