Skip to content · ⁨Lompat ke konten⁩

Counting and averaging · ⁨Menghitung dan rata-rata⁩

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

Bahasa Indonesia

Meringkas dengan fungsi agregat

Terkadang Anda tidak ingin melihat barisnya sendiri, melainkan ringkasan dari baris-baris tersebut. Fungsi agregat mengubah banyak baris menjadi satu nilai:

  • COUNT(*) — berapa banyak baris
  • SUM(col) — total jumlah
  • AVG(col) — rata-rata
  • MIN(col) / MAX(col) — terkecil / terbesar
SELECT COUNT(*) FROM student;

COUNT, SUM dan AVG mereduksi seluruh kolom menjadi satu angka masing-masing

Handout · ⁨Lembar Kerja⁩

Log in or create account · ⁨Masuk atau buat akun⁩

IGCSE, A-Level & AP