Blog · Guide
SQL COUNT, SUM, AVG, MIN, MAX Explained
Aggregate functions collapse many rows into one number — how many customers, average age, min/max price.
One number from many rows
SELECT COUNT(*) AS total_customers FROM customers;
COUNT(*)— how many rowsSUM(qty)— add numbersAVG(age)— meanMIN/MAX— extremes
Aggregates need parentheses
Write COUNT(*), not bare COUNT. When you mix aggregates with plain columns, you usually need GROUP BY.
Try it yourself
The fastest way to lock this in is a short drill on the same Northstar Market tables.