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

PPTX
AGGREGATE FUNCTION.pptx
PPTX
database_set_operations_&_function.pptx
PPTX
it skill excel sheet for ppt.pptx
PPTX
Using Excel Functions
PPT
Introduction to Oracle Functions--(SQL)--Abhishek Sharma
PDF
Key functions in_oracle_sql
PPT
PHP mysql Aggregate functions
PPTX
Advance excel
AGGREGATE FUNCTION.pptx
database_set_operations_&_function.pptx
it skill excel sheet for ppt.pptx
Using Excel Functions
Introduction to Oracle Functions--(SQL)--Abhishek Sharma
Key functions in_oracle_sql
PHP mysql Aggregate functions
Advance excel

Similar to aggregatefunction-220420051702.pptx aggregate (20)

PDF
Introduction to oracle functions
PDF
5.Agg. Function.pdf
PDF
MySQL-commands.pdf
PDF
2. mathematical functions in excel
PDF
Oracle Advanced SQL and Analytic Functions
PPTX
count^J Product^J functions.pptx
PPTX
Oracle: Functions
PPTX
Oracle: Functions
PPTX
Exploring Advanced SQL Techniques Using Analytic Functions
PPTX
Exploring Advanced SQL Techniques Using Analytic Functions
PDF
Sql wksht-3
PPTX
ADV Powepoint 3 Lec.pptx
ODP
Mysql1
PPTX
ADV PPT 8 LAB.pptx
ODP
ODP
PPTX
MS Sql Server: Doing Calculations With Functions
PPTX
MS SQLSERVER:Doing Calculations With Functions
PPTX
MS SQL SERVER: Doing Calculations With Functions
DOCX
Database Query Using SQL_ip.docx
Introduction to oracle functions
5.Agg. Function.pdf
MySQL-commands.pdf
2. mathematical functions in excel
Oracle Advanced SQL and Analytic Functions
count^J Product^J functions.pptx
Oracle: Functions
Oracle: Functions
Exploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic Functions
Sql wksht-3
ADV Powepoint 3 Lec.pptx
Mysql1
ADV PPT 8 LAB.pptx
MS Sql Server: Doing Calculations With Functions
MS SQLSERVER:Doing Calculations With Functions
MS SQL SERVER: Doing Calculations With Functions
Database Query Using SQL_ip.docx
Ad

More from sadiariasat10 (20)

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

Recently uploaded (20)

PDF
IFRS Notes in your pocket for study all the time
PDF
How to Get Funding for Your Trucking Business
PDF
Nante Industrial Plug Factory: Engineering Quality for Modern Power Applications
PDF
Module 3 - Functions of the Supervisor - Part 1 - Student Resource (1).pdf
PPTX
svnfcksanfskjcsnvvjknsnvsdscnsncxasxa saccacxsax
PPT
340036916-American-Literature-Literary-Period-Overview.ppt
PDF
SIMNET Inc – 2023’s Most Trusted IT Services & Solution Provider
PDF
Digital Marketing & E-commerce Certificate Glossary.pdf.................
PDF
Module 2 - Modern Supervison Challenges - Student Resource.pdf
PDF
Family Law: The Role of Communication in Mediation (www.kiu.ac.ug)
PPTX
Sales & Distribution Management , LOGISTICS, Distribution, Sales Managers
PDF
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
PDF
Hindu Circuler Economy - Model (Concept)
PDF
Ôn tập tiếng anh trong kinh doanh nâng cao
PDF
TyAnn Osborn: A Visionary Leader Shaping Corporate Workforce Dynamics
PDF
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034
PDF
NISM Series V-A MFD Workbook v December 2024.khhhjtgvwevoypdnew one must use ...
PDF
NEW - FEES STRUCTURES (01-july-2024).pdf
PDF
Power and position in leadershipDOC-20250808-WA0011..pdf
PDF
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
IFRS Notes in your pocket for study all the time
How to Get Funding for Your Trucking Business
Nante Industrial Plug Factory: Engineering Quality for Modern Power Applications
Module 3 - Functions of the Supervisor - Part 1 - Student Resource (1).pdf
svnfcksanfskjcsnvvjknsnvsdscnsncxasxa saccacxsax
340036916-American-Literature-Literary-Period-Overview.ppt
SIMNET Inc – 2023’s Most Trusted IT Services & Solution Provider
Digital Marketing & E-commerce Certificate Glossary.pdf.................
Module 2 - Modern Supervison Challenges - Student Resource.pdf
Family Law: The Role of Communication in Mediation (www.kiu.ac.ug)
Sales & Distribution Management , LOGISTICS, Distribution, Sales Managers
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
Hindu Circuler Economy - Model (Concept)
Ôn tập tiếng anh trong kinh doanh nâng cao
TyAnn Osborn: A Visionary Leader Shaping Corporate Workforce Dynamics
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034
NISM Series V-A MFD Workbook v December 2024.khhhjtgvwevoypdnew one must use ...
NEW - FEES STRUCTURES (01-july-2024).pdf
Power and position in leadershipDOC-20250808-WA0011..pdf
BsN 7th Sem Course GridNNNNNNNN CCN.pdf

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