Database Management
MySQL
Subjective
Oct 01, 2025
What are SQL aggregate functions? Provide examples.
Detailed Explanation
Aggregate functions perform calculations on multiple rows and return a single value.
Common functions:
• COUNT() - counts rows
• SUM() - adds values
• AVG() - calculates average
• MAX() - finds maximum
• MIN() - finds minimum
Example:
SELECT COUNT(*) as total_users,
AVG(age) as avg_age,
MAX(salary) as max_salary
FROM employees;
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts