COUNT, SUM, AVG, MIN, MAX
These are aggregate functions used to perform calculations on data.
Example: Using COUNT and SUM
SELECT COUNT(*) AS TotalFighters, SUM(ContributionAmount) AS TotalContribution
FROM FreedomFighters;
Output:
Returns the total number of freedom fighters and the sum of their contributions.
Notes
COUNT
: Counts the number of rows.SUM
: Calculates the total sum of a numeric column.AVG
: Calculates the average value.MIN
andMAX
: Find the minimum and maximum values.