본문 바로가기

계산 및 평균 구하기

English
Summarising with aggregate functions

Sometimes you do not want the rows themselves, but a summary of them. Aggregate functions turn many rows into a single value:

  • COUNT(*) — how many rows
  • SUM(col) — the total
  • AVG(col) — the average
  • MIN(col) / MAX(col) — the smallest / largest
SELECT COUNT(*) FROM student;

COUNT, SUM and AVG reduce a whole column to a single number each

교재 자료

로그인 또는 계정 만들기

IGCSE, A-Level & AP