Skip to content · ⁨الانتقال إلى المحتوى⁩

Counting and averaging · ⁨العد والمتوسط الحسابي⁩

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

العربية

تلخيص مع الدوال المجمعة

أحيانًا لا تريد الصفوف نفسها، بل ملخصًا لها. الدوال المجمعة تحول العديد من الصفوف إلى قيمة واحدة:

  • COUNT(*) — عدد الصفوف
  • SUM(col) — المجموع الكلي
  • AVG(col) — المتوسط الحسابي
  • MIN(col) / MAX(col) — الأصغر / الأكبر
SELECT COUNT(*) FROM student;

COUNT و SUM و AVG تقلل عموداً كاملاً إلى رقم واحد لكل منها

Handout · ⁨ورقة عمل⁩

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP