Question:

Explain the use of any three aggregate functions in SQL.

Show Hint

Use SUM, AVG, and COUNT to perform quick calculations on large datasets in SQL.
Updated On: Jul 14, 2025
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Aggregate functions in SQL perform a calculation on a set of values and return a single value.
They are widely used in data analysis, reporting, and summarization.
Three common aggregate functions are:
(i) SUM(): This function adds up all values in a numeric column.
Example: SELECT SUM(salary) FROM employees; returns the total salary of all employees.
(ii) AVG(): Computes the average value of a numeric column.
Example: SELECT AVG(marks) FROM students; gives the average marks of all students.
(iii) COUNT(): Returns the number of rows or entries in a column.
Example: SELECT COUNT(*) FROM orders; counts the total number of orders.
These functions are often used with GROUP BY and HAVING clauses for advanced data analysis.
Was this answer helpful?
0
0

Top Questions on SQL

View More Questions