SQL Count,Avg,Sum SQL COUNT function is used for counting. SQL AVG function is used for average value. SQL SUM function is used for total sum. SELECT COUNT(column_name) FROM (table_name) SELECT AVG(column_name) FROM (table_name) SELECT SUM(column_name) FROM (table_name) Return total number of price from Customer Table. SELECT Count(Price) FROM Customer Find the average price from Customer Table. SELECT Avg(Price) FROM Customer Find the total sum of price from Customer Table. SELECT SUM(Price) FROM Customer
SQL Min and Max SQL Min is used to return smallest value. SQL Max is used to return largest value. SELECT MIN(column_name) FROM table_name WHERE condition. SELECT MAX(column_name) FROM table_name WHERE condition. Return smallest value of quantity from Customer Table: SELECT MIN(Quantity) FROM Customer. Return largest value of quantity from Customer Table: SELECT MAX(Quantity) FROM Customer.