What is meant by Group Functions in SQL?

There are functions which return a value for each single row selected. Example of such functions are Arithmetic functions like ABS(column name) in SQL. But in contrast group functions are one in which summary or result of the group of rows is got. For example in an entity DEPARTMENT there may be instance in which the programmer may like to get the average salary of a particular department say d1. This is as situation in which one must apply the function for a group of rows in this instance on applying the group function on the column salary and to get for the department d1 on must use the where function along with this. So achieving the above the programmer could write as


SELECT AVG(salary) from DEPARTMENT WHERE DEPTID=’d1’;


Like the above there are several group functions available in SQL. Some of them are given below namely:



  • AVG( )

  • COUNT( )

  • SUM( )

  • MAX( )

  • MIN( )

Questions by GeekAdmin   answers by GeekAdmin

 

This Question is not yet answered!

 
 

Related Answered Questions

 

Related Open Questions