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 |
Tags
- Jackson
- 책리뷰
- 항해99
- post
- Real MySQL
- 미니프로젝트
- 정보처리기사
- algorithms
- 회고
- 알고리즘
- LeetCode
- 뇌정리
- 필기
- 2020년 제4회 정보처리기사 필기 문제 분석
- 코드숨
- Til
- 함수형 코딩
- 서평
- 2020년 정보처리기사 4회
- 성적프로그램
- git
- 2020년 일정
- 주간회고
- hackerrank
- sqldeveloper
- If
- 스터디
- java
- jsp
- Python
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 |