Aggregate Functions

Avg Function

SELECT Avg(unitPrice) AS AveragePrice FROM products;

In Avg, NULL values are ignored.

Count Function

SELECT COUNT(*) as Total FROM products; //Here NULL are not ignored
SELECT COUNT(id) as Total FROM products; //Here NULL are IGNORED

Min / Max Function

SELECT MAX(price) as MaximumPrice FROM Stocks;

Sum Function

SELECT Sum (unitprice*amount) AS total FROM Students;