문제/SQL

23.10.08. solver sql 06. 데이터 그룹으로 묶기

잇꼬 2023. 10. 8. 23:36
728x90
반응형
SMALL

https://solvesql.com/problems/group-by/

해당 문제는 

SELECT문, GROUP BY절, round, avg 을 이용해 

쿼리문을 작성하는 문제이다.

 

SELECT 
  quartet, 
  round(avg(x), 2) as x_mean , 
  round(variance(x), 2) as x_var ,
  round(avg(y), 2) as y_mean ,
  round(variance(y), 2) as y_var
FROM points
GROUP BY quartet;

 

 round(값, 자릿수) : 소수점 반올림 함수
avg() : 평균 계산 함수
variance() : 집계함수 또는 분석함수

 

https://solvesql.com/problems/group-by/

 

https://solvesql.com/problems/group-by/

 

solvesql.com

 

728x90
반응형
LIST