728x90
We Do not allow non ASCII characters for this challenge 와 같은 유사한 오류문구가 출력됐었는데,
아직 언제 이런 오류가 뜨는건지는 잘 모르겠다.
어쨌든 아래는 처음에 안되었지만.. 다시해보니 성공한 query이다.
concat과 substr, lower를 테스트하는 문제였던 것 같다.
아 그리고 또 한가지.
두가지 결과를 얻고자 할때 union(all)을 사용하지 않아도 자동으로 두 쿼리문의 결과를 union해서 판정한다.
-- Hackerrank_The PADS (https://www.hackerrank.com/challenges/the-pads/problem?isFullScreen=true)
-- SQL(Intermediate)
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;
728x90
728x90
'코딩테스트 > HackerRank' 카테고리의 다른 글
[SQL] order by substr (Oracle) (0) | 2022.06.28 |
---|---|
[Advanced Select] Type of Triangle (0) | 2022.06.26 |
[Basic Join] Contest Leaderboard(Oracle) (0) | 2022.05.17 |
[Basic Join] Top Competitors(Oracle) (0) | 2022.05.03 |
[Basic Join] The Report(Oracle) (0) | 2022.05.03 |