What are Aggregate functions in SQL

0
47

In database management an aggregate function is a function where the values of multiple rows are grouped together as input on certain criteria to form a single value of more significant meaning.

Various Aggregate Functions are as follows:

1) Count()

2) Sum()

3) Avg()

4) Min()

5) Max()

 

Count():

Count(*): Returns total number of records .i.e 6.
Count(salary): Return number of Non Null values over the column salary. i.e 5.
Count(Distinct Salary):  Return number of distinct Non Null values over the column salary .i.e 4

 

Sum():

sum(salary):  Sum all Non Null values of Column salary i.e., 310
sum(Distinct salary): Sum of all distinct Non-Null values i.e., 25

 

Avg():

Avg(salary) = Sum(salary) / count(salary) = 310/5
Avg(Distinct salary) = sum(Distinct salary) / Count(Distinct Salary) = 250/4

 

Min():

Min(salary): Minimum value in the salary column except NULL i.e., 40.
Max(salary): Maximum value in the salary i.e., 80.

Search
Categories
Read More
Other
Anti-Seize Compounds Market Unveiling Driving Factors, Strategies, and Forecasted Trends by Fact MR
The anti-seize compounds market is valued at USD 201.9 million in 2025. As per Fact.MR...
By Akshay Gorde 2025-06-10 14:06:18 0
Networking
Ethylene Dichloride Market Innovates for Plastics Industry
Ethylene Dichloride (EDC) is a key chemical in the global plastics industry, particularly for...
By Bablya Bhau 2025-06-25 19:13:10 0
Other
Inkjet vs. Laser: Technology Battles in the Copier Market
The global Copier Market continues its upward trajectory, with industry valuation reaching US$...
By Mayur Gunjal 2025-07-10 07:58:07 0
Other
Automotive Composite Liftgate Market: Revolutionizing Vehicle Design and Efficiency
The automotive industry is under constant pressure to innovate and improve the efficiency,...
By Myra Miller 2025-06-13 10:53:41 0
Office Equipment and Supplies
Engaging Webinar Ideas for 2025: Drive Leads, Educate Audiences, and Boost Conversions
Introduction: Webinars Have Evolved. So Should Your Strategy. Webinars are no longer just...
By Robert Haas 2025-06-20 10:23:37 0
Omaada - A global social and professionals networking platform https://www.omaada.com