Professional Documents
Culture Documents
NO : 293575057 DEPT : IT
AGGREGATE FUNCTIONS
The Aggregate Functions are :
AVG
MIN
MAX
SUM
COUNT
AVG :
Syntax:
select avg(<field_name>) from <table_name>;
Description:
Determines the Average of the specified values of column, ignoring null values.
MIN :
Syntax:
select min(<field_name>) from <table_name>;
Description:
Determines the Minimum value of a specified column, ignoring null values.
MAX :
Syntax:
select max(<field_name>) from <table_name>;
Description:
Determines the Maximum value of a specified column, ignoring null values.
SUM :
Syntax:
select sum(<field_name>) from <table_name>;
Description:
Determines the Sum of a specified column, ignoring null values.
COUNT :
Syntax:
select count(*) from <table_name>;
select count(<field_name>) from <table_name>;
Description:
Determines the Total number of vales of a specified column.
VARIANCE :
Syntax:
select variance(<field_name>) from <table_name>;
Description:
Determines the Variance of expression, ignoring null values.
STDDEV :
Syntax:
select stddev(<field_name>) <table_name>;
Description:
Determines the Standard deviation of a specified column, ignoring null values.
PROGRAM TO LEARN AGGREGATE FUNCTIONS
AVG(MARKS)
---------------------------
90.6
MIN(MARKS)
---------------------------
75
MAX(MARKS)
---------------------------
100
COUNT(MARKS)
---------------------------
5
SQL> select COUNT(*) from Student;
COUNT(*)
---------------------------
5
SUM(MARKS)
---------------------------
453
VARIANCE(MARKS)
---------------------------
109.3
STDDEV(MARKS)
---------------------------
10.454664
SQL>
RESULT :
Thus, the Aggregate Functions are executed and verified.