-
[HackerRank/Advanced Select] The PADS공부/PS ( SQL) 2022. 5. 16. 01:29
https://www.hackerrank.com/challenges/the-pads/problem
문제
풀이
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
- CONCAT(문자열1, 문자열2, ..., 문자열 N) : 문자열1 + 문자열2 + ... + 문자열 N
- LOWER(문자열): 문자열을 소문자로 바꿔줌
- GROUP BY: 컬럼을 그룹화 할 때 사용함
https://extbrain.tistory.com/56
'공부 > PS ( SQL)' 카테고리의 다른 글
[HackerRank/Aggregation] Revising Aggregations - Averages (0) 2022.05.18 [HackerRank/Aggregation] Revising Aggregations - The Count Function (0) 2022.05.17 [HackerRank/Advanced Select] Type of Triangle (0) 2022.05.16 [HackerRank/Basic Select] Employee Salaries (0) 2022.05.16 [HackerRank/Basic Select] Employee Names (0) 2022.05.16