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.

Site içinde arama yapın
Kategoriler
Read More
Other
The Role of Ultrasound Simulators in Shaping Future Healthcare Training
Ultrasound simulators are gaining prominence in the medical field due to their ability to provide...
By Ananya Birla 2025-06-23 09:41:07 0
Other
Fueling Steel: Iron Ore Pellets Market Dynamics in MEA
"Executive Summary Middle East and Africa Iron Ore Pellets Market :     The...
By Dbmrraaj Sinha 2025-07-01 06:03:38 0
Other
Love Good Morning Images
Romantic Good Morning Love Images for Couples – Start Your Day with Love Looking to make...
By Technology Welldone 2025-06-19 04:19:41 0
Other
How Polyamide Imide Resin Improves Industrial Coatings
Polyamide Imide (PAI) resin is a high-performance thermosetting polymer prized for its...
By Shubham Gurav 2025-06-11 11:01:21 0
Other
プラスチック自動リサイクル装置の最新調査レポート:市場規模、競合環境、成長要因2025
QYResearch株式会社(所在地:東京都中央区)は、最新の調査資料「プラスチック自動リサイクル装置―グローバル市場シェアとランキング、全体の売上と需要予測、2025~2031」を2025年7...
By Liu Yuan 2025-07-04 10:24:30 0
Omaada - A global social and professionals networking platform https://www.omaada.com