Aggregate functions (COUNT, SUM, AVG)
Në shqip: Funksionet përmbledhëse
ShpjegimiSQ
COUNT() numëron rreshtat, SUM() mbledh, AVG() jep mesataren, MAX() dhe MIN() gjejnë ekstremet. Shpesh përdoren me GROUP BY për të llogaritur sipas grupeve.
EnglishEN
COUNT() counts rows, SUM() adds up, AVG() gives the average, MAX() and MIN() find the extremes. They're often used with GROUP BY to compute per group.
Si ta mendosh
Si të llogaritësh mesataren dhe notën më të lartë të klasës.
Lexoje në anglisht
Like working out the class average and the top grade.
Shembull kodisql
SELECT klasa, COUNT(*) AS nxenes, AVG(nota) AS mesatarja
FROM nxenesit
GROUP BY klasa;