What are aggregate functions? What is their use? Give some examples.

  • Aggregate functions work with multiple rows of table at a time and return single aggregate value.
  • It is basically used to produce summarized data from our database.
  • Basically there are five aggregate functions:
    COUNT()
    – AVG()
    – MIN()
    – MAX()
    – SUM()

    Examples
    SELECT SUM(Total) FROM ITEM;

SELECT AVG(Marks) FROM Student;

SELECT DeptNo, MAX(Salary)
FROM Employee
GROUP BY DeptNo;

error: Content is protected !!