Returns the average value of expr. AVG() returns NULL if there were no matching rows.
SELECT student_name, AVG(test_score) FROM student // returns average test_score.
Returns a count of the number of non-NULL values of expr in the rows retrieved by a SELECT statement. The result is a BIGINT value. COUNT() returns 0 if there were no matching rows.
SELECT COUNT(gen) FROM gender ;// 2 COUNT(*) is somewhat different in that it returns a count of the number of rows retrieved, whether or not they contain NULL values.
SELECT COUNT(*) FROM gender; // 3
Returns the sum of expr. SUM() returns NULL if there were no matching rows.
SELECT SUM(salary) AS gp_total_sal FROM emp GROUP BY team HAVING team_size <5; // Returns the sum of the salary of every group having team size less than 5.
Returns the maximum value of expr. MAX() returns NULL if there were no matching rows.
SELECT MAX(test_score) FROM student GROUP BY student_name; //Returns the maximum test_score of individual student.
Returns the minimum value of expr. MIN() returns NULL if there were no matching rows.
SELECT MIN(test_score), MAX(test_score) FROM student GROUP BY student_name; //Returns the minimum and maximum test_score of individual student.
This function returns a comma separated string result with the concatenated non-NULL values from a group. It returns NULL if there are no non-NULL values.
SELECT GROUP_CONCAT(test_score) AS cm_separated FROM student GROUP BY student_name;