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
- 웨어하우스 보관 최적화
- 딥러닝
- TensorFlowGPU
- tensorflow
- Labor Management System
- leetcode
- ProfileReport
- MySQL
- 코딩테스트
- pandas profiling
- 피그마인디언
- MS SQL Server
- 프로그래머스
- Product Demand
- forecast
- Inventory Optimization
- eda
- SQL
- ABC Analysis
- 코딩테스트연습
- 당신의 인생이 왜 힘들지 않아야 한다고 생각하십니까
- ModelCheckPoint
- kaggle
- SKU Consolidation
- HackerRank
- 데이터분석
- 신경쓰기의 기술
- Gaimification
- 파이썬
- oracle
Archives
- Today
- Total
오늘도 배운다
The Blunder / HackerRank, SQL, MySQL 본문
문제
Samantha was tasked with calculating the average monthly salaries for all employees in the EMPLOYEES table, but did not realize her keyboard's 0 key was broken until after completing the calculation. She wants your help finding the difference between her miscalculation (using salaries with any zeros removed), and the actual average salary.
Write a query calculating the amount of error (i.e.: actual - miscalculated average monthly salaries), and round it up to the next integer.
제출답안(MySQL)
SELECT CEIL(AVG(salary) - AVG(REPLACE(salary, 0, '')))
FROM employees
문제 바로가기(MySQL)
728x90
'코딩테스트연습(SQL)' 카테고리의 다른 글
Weather Observation Station 13 / HackerRank, SQL, MySQL (0) | 2022.12.22 |
---|---|
Top Earners / HackerRank, SQL, MySQL (0) | 2022.12.15 |
The PADS / HackerRank, SQL, MySQL (0) | 2022.12.05 |
Type of Triangle / HackerRank, SQL, MySQL (0) | 2022.12.04 |
Higher Than 75 Marks / HackerRank, SQL, MySQL (0) | 2022.12.01 |
Comments