본문 바로가기
  • 공부 기록 인생 기록
SQL/공부

Codecademy - Aggregate Functions

by 티권 2023. 2. 5.

'downloads' 하면 안됨

그룹화 해줘야함

avg함수 없이 그냥 downloads라고만 하면 각 그룹의 첫번 째 값으로 반환됨

We can’t use WHERE here because we don’t want to filter the rows; we want to filter groups

 

  • COUNT(): count the number of rows
  • SUM(): the sum of the values in a column
  • MAX()/MIN(): the largest/smallest value
  • AVG(): the average of the values in a column
  • ROUND(): round the values in the column

Aggregate functions combine multiple rows together to form a single value of more meaningful information.

  • GROUP BY is a clause used with aggregate functions to combine data from one or more columns.
  • HAVING limit the results of a query based on an aggregate property.

'SQL > 공부' 카테고리의 다른 글

select 문 총정리  (0) 2023.07.09
개념적 데이터 모델링, ERD  (0) 2023.02.07
Codecademy - Multiple Tables  (0) 2023.02.05
Codecademy - Queries  (0) 2023.02.05
sql select문, join (생활코딩)  (0) 2023.02.04