Please enable JavaScript.
Coggle requires JavaScript to display documents.
Aggregate Functions (COUNT (SELECT COUNT(...) FROM ...;, SELECT…
Aggregate Functions
COUNT
SELECT COUNT(...) FROM ...;
SELECT COUNT(DISTINCT ...) FROM ...;
SUBQUERY
SELECT * FROM ... WHERE ... = (SELECT Min(...) FROM ....);
subquery fires first
slow
better way select * from .. order by ... asc limit 1;
GROUP BY
groups data into single rows
SELECT ..., COUNT(*) FROM ... GROUP BY ...;
SUM
select sum(...) ... from ...;
select sum(...) from ... group by ...;
average = AVG
select avg(...) from ....;
doesn't round
combines data
MIN and MAX