23 January 2014

SELECT command with AVG () function

AVG () function are widely used to calculate the average of column value that is The AVG () function returns the average value of a numeric column.

Syntax:

SELECT AVG [SPECIFIED_COLUMN_NAME] FROM <TABLE_NAME>

Example:

                ---- CALCULATE AVERAGE OF SALARY IN DATABASE TABLE STUDENT_MARKS
SELECT AVG(SALARY) AS AVERAGE FROM STUDENT_MARKS

No comments:

Post a Comment