SlideShare a Scribd company logo
AGGREGATE FUNCTION
SQL AGGREGATE FUNCTION
 SQL aggregation function is used to perform the calculation
on multiple rows of a single column of a table. It returns a
single value.
 It is also used to summarize the data.
 This function ignore the null values except the count
function .
aggregatefunction-220420051702.pptx aggregate
TYPES OF SQL AGGREGATION FUNCTION
Count ( ) : Returns the numbers of rows
Sum ( ) : Returns the sum
Avg ( ) : Returns the average value
Max ( ) : Returns the smallest value
Min ( ) : Returns the largest value
COUNT FUNCTION
Count function is used to count the number of rows in database table
.It can work on both numeric and non-numeric data types.
Count function uses the count (*) that returns the count of all the
rows in a specific table. Count (*) considers duplicate and null .
This function does not count the null value .
Table name :Employee
EXAMPLE :TABLE
NAME DATE PAGES
RAMU 22022-01-12 34
GEETHA 22022-01-12 74
SEETHA 22022-01-12 64
RAM 22022-01-12 94
SUKRIA 22022-01-12 64
SYNTAX OF COUNT
Syntax: select count(Pages) from employee;
Count (pages)
5
1 row in set
Syntax: select count (name) from employee;
Count(name)
5
1 row in set
SUM FUNCTION
• Sum() function is an aggregate function that calculates the sum of
all or distinct values in an expression .
SYNTAX: SELECT SUM (PAGES) FROM EMPLOYEE;
SUM(PAGES)
330
1 ROW IN A SET
AVERAGE FUNCTION
• The avg function is used to calculate the average value of the
numeric type. Average function returns the average of all non-null
values.
syntax: select avg (pages)from employee;
avg(pages)
66.0000
1row in set
MAX FUNCTION
• Max function is used to find the maximum value of certain column.
This function determines the largest value of all selected values of
columns.
Syntax: select max (pages) from employee;
Max(pages)
94
1 row in set
MIN FUNCTION
• The Min function is used to find the minimum value of certain
column. This function determines the smallest value of all selected
values of a column.
syntax: Select min(pages)from employee ;
Min(pages)
34
1 row in set

More Related Content

Similar to aggregatefunction-220420051702.pptx aggregate (20)

PPT
MYSQL Aggregate Functions
Leroy Blair
 
PPT
Introduction to Oracle Functions--(SQL)--Abhishek Sharma
अभिषेक शर्मा
 
PPTX
database_set_operations_&_function.pptx
tanvirkhanfahim
 
PPTX
sql function(ppt)
Ankit Dubey
 
DOCX
Database Query Using SQL_ip.docx
VandanaGoyal21
 
PDF
Sql group functions
Vivek Singh
 
PPTX
Aggregate function
Rayhan Chowdhury
 
PDF
Introduction to oracle functions
Nitesh Singh
 
PPTX
SQL.pptx
MrHello6
 
RTF
Sql functions
ilias ahmed
 
PDF
MySQL-commands.pdf
ssuserc5aa74
 
PPTX
Lecture 8 DML3 aggregate functions in DB.pptx
imranahmadrana28
 
PPTX
Aggregate functions
Rosie Jane Enomar
 
PPTX
AGGREGATE FUNCTION SWITH SYNTAX FOR EASY LEARNING OF PYTHON
examcelldavrng
 
PPTX
MS Sql Server: Doing Calculations With Functions
DataminingTools Inc
 
PPTX
MS SQLSERVER:Doing Calculations With Functions
sqlserver content
 
PPTX
MS SQL SERVER: Doing Calculations With Functions
sqlserver content
 
PDF
SQL-AGG-FUN.pdfiiiijuyyttfffgyyuyyyyyhhh
NaveeN547338
 
PDF
Sql wksht-3
Mukesh Tekwani
 
PPT
Sql group functions
Sumit Tambe
 
MYSQL Aggregate Functions
Leroy Blair
 
Introduction to Oracle Functions--(SQL)--Abhishek Sharma
अभिषेक शर्मा
 
database_set_operations_&_function.pptx
tanvirkhanfahim
 
sql function(ppt)
Ankit Dubey
 
Database Query Using SQL_ip.docx
VandanaGoyal21
 
Sql group functions
Vivek Singh
 
Aggregate function
Rayhan Chowdhury
 
Introduction to oracle functions
Nitesh Singh
 
SQL.pptx
MrHello6
 
Sql functions
ilias ahmed
 
MySQL-commands.pdf
ssuserc5aa74
 
Lecture 8 DML3 aggregate functions in DB.pptx
imranahmadrana28
 
Aggregate functions
Rosie Jane Enomar
 
AGGREGATE FUNCTION SWITH SYNTAX FOR EASY LEARNING OF PYTHON
examcelldavrng
 
MS Sql Server: Doing Calculations With Functions
DataminingTools Inc
 
MS SQLSERVER:Doing Calculations With Functions
sqlserver content
 
MS SQL SERVER: Doing Calculations With Functions
sqlserver content
 
SQL-AGG-FUN.pdfiiiijuyyttfffgyyuyyyyyhhh
NaveeN547338
 
Sql wksht-3
Mukesh Tekwani
 
Sql group functions
Sumit Tambe
 

More from sadiariasat10 (20)

PPTX
transactionprocessingppt-171212112608.pptx
sadiariasat10
 
PPTX
BrownbagIntrotosqltuning.pptx SQL tunning
sadiariasat10
 
PPTX
BrownbagIntrotosqltuning.pptx SQL tunning
sadiariasat10
 
PPTX
48131.pptx researching methods research methods
sadiariasat10
 
PPTX
6._Research_methods_quan_qual_and_mixed_Paul_B_and_Anne_J.ppt methods x
sadiariasat10
 
PPTX
IS-Overview.pptx information system in business
sadiariasat10
 
PPTX
DDL and DML.pptx ddl vs dml ddl and dml ddl and dml
sadiariasat10
 
PPTX
me-introduction-may-2.pptx intro to basic
sadiariasat10
 
PPTX
module-5-session-1.pptx module 5 session
sadiariasat10
 
PPTX
hrm301-10.pptx HRm HRM HRM HRM HRM HRM HRM HRM
sadiariasat10
 
PPTX
EquityReinforcement.pptx Equity theory in
sadiariasat10
 
PPTX
Normalization.pptx Functional dependence
sadiariasat10
 
PPTX
ch13.pptx Database effefiency and tuning
sadiariasat10
 
PPTX
ieee802-11.pptx wireless lan IEEE 802 11
sadiariasat10
 
PPTX
IEEE-802.11overview.pptx ieee 802 11 overview
sadiariasat10
 
PPTX
lecture22.pptx relational Algebra basics types
sadiariasat10
 
PPTX
signal propagation.pptx basics of signal propagation
sadiariasat10
 
PPTX
lan-141028090025-conversion-gate02.pptx LAN MAN WAN
sadiariasat10
 
PPTX
DOC-20240829-WA0013..pptx introduction to LAN Man and wan
sadiariasat10
 
PPTX
Website-IASBO-SBOA-How-to-prepare-for-an-audit.pptx
sadiariasat10
 
transactionprocessingppt-171212112608.pptx
sadiariasat10
 
BrownbagIntrotosqltuning.pptx SQL tunning
sadiariasat10
 
BrownbagIntrotosqltuning.pptx SQL tunning
sadiariasat10
 
48131.pptx researching methods research methods
sadiariasat10
 
6._Research_methods_quan_qual_and_mixed_Paul_B_and_Anne_J.ppt methods x
sadiariasat10
 
IS-Overview.pptx information system in business
sadiariasat10
 
DDL and DML.pptx ddl vs dml ddl and dml ddl and dml
sadiariasat10
 
me-introduction-may-2.pptx intro to basic
sadiariasat10
 
module-5-session-1.pptx module 5 session
sadiariasat10
 
hrm301-10.pptx HRm HRM HRM HRM HRM HRM HRM HRM
sadiariasat10
 
EquityReinforcement.pptx Equity theory in
sadiariasat10
 
Normalization.pptx Functional dependence
sadiariasat10
 
ch13.pptx Database effefiency and tuning
sadiariasat10
 
ieee802-11.pptx wireless lan IEEE 802 11
sadiariasat10
 
IEEE-802.11overview.pptx ieee 802 11 overview
sadiariasat10
 
lecture22.pptx relational Algebra basics types
sadiariasat10
 
signal propagation.pptx basics of signal propagation
sadiariasat10
 
lan-141028090025-conversion-gate02.pptx LAN MAN WAN
sadiariasat10
 
DOC-20240829-WA0013..pptx introduction to LAN Man and wan
sadiariasat10
 
Website-IASBO-SBOA-How-to-prepare-for-an-audit.pptx
sadiariasat10
 
Ad

Recently uploaded (20)

PDF
HOW TO RECOVER LOST CRYPTOCURRENCY - VISIT iBOLT CYBER HACKER COMPANY
diegovalentin771
 
PDF
Top Trends Redefining B2B Apparel Exporting in 2025
ananyaa2255
 
PPTX
Event Budgeting. Various factors to consider for event budgeting
TintoAnil
 
PDF
_How Freshers Can Find the Best IT Companies in Jaipur with Salarite.pdf
SALARITE
 
PDF
BeMetals_Presentation_July_2025 .pdf
DerekIwanaka2
 
PPTX
World First Cardiovascular & Thoracic CT Scanner
arineta37
 
PDF
Flexible Metal Hose & Custom Hose Assemblies
McGill Hose & Coupling Inc
 
PDF
Top 10 Emerging Tech Trends to Watch in 2025.pdf
marketingyourtechdig
 
PPTX
25 Future Mega Trends Reshaping the World in 2025 and Beyond
presentifyai
 
PDF
Native Sons Of The Golden West - Boasts A Legacy Of Impactful Leadership
Native Sons of the Golden West
 
PDF
Why Unipac Equipment Leads the Way Among Gantry Crane Manufacturers in Singap...
UnipacEquipment
 
PDF
Cloud Budgeting for Startups: Principles, Strategies, and Tools That Scale
Amnic
 
PDF
Reflect, Refine & Implement In-Person Business Growth Workshop.pdf
TheoRuby
 
PPTX
Phygital & Omnichannel Retail: Navigating the Future of Seamless Shopping
RUPAL AGARWAL
 
PDF
3rd Edition of Human Resources Management Awards
resources7371
 
PDF
Gabino Barbosa - A Master Of Efficiency
Gabino Barbosa
 
PDF
Smart Lead Magnet Review: Effortless Email List Growth with Automated Funnels...
Larry888358
 
PDF
How do we fix the Messed Up Corporation’s System diagram?
YukoSoma
 
PPTX
Hackathon - Technology - Idea Submission Template -HackerEarth.pptx
nanster236
 
PPTX
Revolutionizing Retail: The Impact of Artificial Intelligence
RUPAL AGARWAL
 
HOW TO RECOVER LOST CRYPTOCURRENCY - VISIT iBOLT CYBER HACKER COMPANY
diegovalentin771
 
Top Trends Redefining B2B Apparel Exporting in 2025
ananyaa2255
 
Event Budgeting. Various factors to consider for event budgeting
TintoAnil
 
_How Freshers Can Find the Best IT Companies in Jaipur with Salarite.pdf
SALARITE
 
BeMetals_Presentation_July_2025 .pdf
DerekIwanaka2
 
World First Cardiovascular & Thoracic CT Scanner
arineta37
 
Flexible Metal Hose & Custom Hose Assemblies
McGill Hose & Coupling Inc
 
Top 10 Emerging Tech Trends to Watch in 2025.pdf
marketingyourtechdig
 
25 Future Mega Trends Reshaping the World in 2025 and Beyond
presentifyai
 
Native Sons Of The Golden West - Boasts A Legacy Of Impactful Leadership
Native Sons of the Golden West
 
Why Unipac Equipment Leads the Way Among Gantry Crane Manufacturers in Singap...
UnipacEquipment
 
Cloud Budgeting for Startups: Principles, Strategies, and Tools That Scale
Amnic
 
Reflect, Refine & Implement In-Person Business Growth Workshop.pdf
TheoRuby
 
Phygital & Omnichannel Retail: Navigating the Future of Seamless Shopping
RUPAL AGARWAL
 
3rd Edition of Human Resources Management Awards
resources7371
 
Gabino Barbosa - A Master Of Efficiency
Gabino Barbosa
 
Smart Lead Magnet Review: Effortless Email List Growth with Automated Funnels...
Larry888358
 
How do we fix the Messed Up Corporation’s System diagram?
YukoSoma
 
Hackathon - Technology - Idea Submission Template -HackerEarth.pptx
nanster236
 
Revolutionizing Retail: The Impact of Artificial Intelligence
RUPAL AGARWAL
 
Ad

aggregatefunction-220420051702.pptx aggregate

  • 2. SQL AGGREGATE FUNCTION  SQL aggregation function is used to perform the calculation on multiple rows of a single column of a table. It returns a single value.  It is also used to summarize the data.  This function ignore the null values except the count function .
  • 4. TYPES OF SQL AGGREGATION FUNCTION Count ( ) : Returns the numbers of rows Sum ( ) : Returns the sum Avg ( ) : Returns the average value Max ( ) : Returns the smallest value Min ( ) : Returns the largest value
  • 5. COUNT FUNCTION Count function is used to count the number of rows in database table .It can work on both numeric and non-numeric data types. Count function uses the count (*) that returns the count of all the rows in a specific table. Count (*) considers duplicate and null . This function does not count the null value . Table name :Employee
  • 6. EXAMPLE :TABLE NAME DATE PAGES RAMU 22022-01-12 34 GEETHA 22022-01-12 74 SEETHA 22022-01-12 64 RAM 22022-01-12 94 SUKRIA 22022-01-12 64
  • 7. SYNTAX OF COUNT Syntax: select count(Pages) from employee; Count (pages) 5 1 row in set Syntax: select count (name) from employee; Count(name) 5 1 row in set
  • 8. SUM FUNCTION • Sum() function is an aggregate function that calculates the sum of all or distinct values in an expression . SYNTAX: SELECT SUM (PAGES) FROM EMPLOYEE; SUM(PAGES) 330 1 ROW IN A SET
  • 9. AVERAGE FUNCTION • The avg function is used to calculate the average value of the numeric type. Average function returns the average of all non-null values. syntax: select avg (pages)from employee; avg(pages) 66.0000 1row in set
  • 10. MAX FUNCTION • Max function is used to find the maximum value of certain column. This function determines the largest value of all selected values of columns. Syntax: select max (pages) from employee; Max(pages) 94 1 row in set
  • 11. MIN FUNCTION • The Min function is used to find the minimum value of certain column. This function determines the smallest value of all selected values of a column. syntax: Select min(pages)from employee ; Min(pages) 34 1 row in set