Skip to content · ⁨Saltar al contenido⁩

Counting and averaging · ⁨Conteo y promedio⁩

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

Español

Resumen con funciones agregadas

A veces no se desean las filas en sí, sino un resumen de ellas. Las funciones agregadas convierten muchas filas en un único valor:

  • COUNT(*) — cuántas filas hay
  • SUM(col) — el total
  • AVG(col) — el promedio
  • MIN(col) / MAX(col) — el más pequeño / el más grande
SELECT COUNT(*) FROM student;

COUNT, SUM y AVG reducen toda una columna a un solo número cada una

Handout · ⁨Material⁩

Log in or create account · ⁨Iniciar sesión o crear cuenta⁩

IGCSE, A-Level & AP