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
- 주간회고
- 책리뷰
- sqldeveloper
- 2020년 제4회 정보처리기사 필기 문제 분석
- 서평
- 미니프로젝트
- jsp
- 항해99
- post
- If
- 코드숨
- algorithms
- 스터디
- 회고
- Real MySQL
- hackerrank
- 뇌정리
- 2020년 일정
- 성적프로그램
- 정보처리기사
- 필기
- Jackson
- 알고리즘
- 2020년 정보처리기사 4회
- 함수형 코딩
- Python
- Til
- git
- java
- LeetCode
Archives
- Today
- Total
조컴퓨터
hackerrank Top Earners 본문
1)
salary * months = earnings
1-1)
SELECT *, salary * months AS earnings
FROM Employee
1-2)
SELECT salary * months AS earnings
FROM Employee
GROUP BY earnings
1-3)
SELECT salary * months AS earnings
FROM Employee
GROUP BY earnings
ORDER BY earnings
1-4)
SELECT salary * months AS earnings
FROM Employee
GROUP BY earnings
ORDER BY earnings DESC
1-5)
SELECT salary * months AS earnings
FROM Employee
GROUP BY earnings
ORDER BY earnings DESC
LIMIT 1;
2) 갯수 출력
COUNT(*)
2-1)
SELECT salary * months AS earnings, COUNT(*)
FROM Employee
GROUP BY earnings
ORDER BY earnings DESC
LIMIT 1;
SUCCESS!
'HackerRank > SQL' 카테고리의 다른 글
hackerrank Weather Observation Station 6 (0) | 2021.01.31 |
---|---|
hackerrank Weather Observation Station 5 (0) | 2021.01.31 |
hackerrank Weather Observation Station 3 (0) | 2021.01.30 |
hackerrank Symmetric Pairs (0) | 2021.01.18 |
hackerrank Type of Triangle (0) | 2021.01.18 |