Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- lv0
- 백준 N과 M 자바
- 버퍼
- 오름차순 정렬
- lv2
- 클라이언트
- 자바
- 삼각형의 완성조건
- 프로그래머스
- 큐
- 백준
- 스프링부트 도커 배포
- 스프링부트 도커
- 스택
- Lv1
- 이진수 변환
- 스프링부트 도커로 배포
- COS Pro
- 프로그래머스 풀이
- SWEA
- StringTokenizer
- java
- Programmers
- 프로그래머스 문자열 정렬
- Stack
- index of
- Queue
- 문자열
- 알고리즘
- 프로그래머스 자바
Archives
- Today
- Total
mun dev
[HackerRank] The Report 오라클 풀이 본문
문제링크
The Report | HackerRank
Write a query to generate a report containing three columns: Name, Grade and Mark.
www.hackerrank.com
풀이
1. case when grade가 8보다 작다면 null로 처리
2. student의 mark를 기준으로 조인
3. marks가 8보다 큰 경우이므로 where절에 조건 추가
4. order by를 사용해 학년별 내림차순, 이름 오름차순, 점수 내림차순
코드
select case when g.grade < 8 then null else s.name end, g.grade, s.marks
from students s join grades g
on s.marks between g.min_mark and g.max_mark
where s.marks > 8
order by g.grade desc, s.name asc, s.marks desc;'알고리즘 > HackerRank' 카테고리의 다른 글
| [HackerRank] Contest Leaderboard 오라클 풀이 (1) | 2024.02.02 |
|---|---|
| [HackerRank] Top Competitors 오라클 풀이 (1) | 2024.01.31 |
| [HackerRank] Average Population of Each Continent 오라클 풀이 (0) | 2024.01.31 |
| [HackerRank] African cities 오라클 풀이 (0) | 2024.01.31 |
| [HackerRank] Weather Observation Station 20 오라클 풀이 (0) | 2024.01.31 |