Reader small image

You're reading from  Data Wrangling with SQL

Product typeBook
Published inJul 2023
PublisherPackt
ISBN-139781837630028
Edition1st Edition
Right arrow
Authors (2):
Raghav Kandarpa
Raghav Kandarpa
author image
Raghav Kandarpa

Raghav Kandarpa is an experienced Data Scientist in Finance and logistics industry with expertise in SQL, Python, Building Machine Learning Models, Financial Data Modelling, and Statistical Analysis. He holds a Masters' degree in Business Analytics specializing in Data Science from the University of Texas at Dallas.
Read more about Raghav Kandarpa

Shivangi Saxena
Shivangi Saxena
author image
Shivangi Saxena

Shivangi Saxena is an experienced BI Engineer with proficiency in SQL, Data Visualization, and Statistical Analysis. She holds a master's degree in Information Technology and Management from the University of Texas at Dallas. She has several years of experience building several BI tools and products using SQL and BI reporting tools which has helped stakeholders to get visibility to the right data points
Read more about Shivangi Saxena

View More author details
Right arrow

SQL aggregate functions

We've covered aggregate functions in the previous chapter, but here's a quick refresher before we compare them with window functions. SQL aggregate functions are functions that perform calculations on a set of values and return an aggregated result after summarization. These functions are used to summarize data within a specified window of rows related to the current row in the result set.

Figure 9.2 – SQL aggregate functions

Figure 9.2 – SQL aggregate functions

Some of the most commonly used SQL aggregate functions are as follows:

  • SUM: Returns the sum of values for a specified column
  • AVG: Returns the average of values for a specified column
  • MIN: Returns the minimum value for a specified column
  • MAX: Returns the maximum value for a specified column
  • COUNT: Returns the number of rows in a specified window

These aggregate functions can be used in conjunction with a window specification to perform complex calculations and...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Data Wrangling with SQL
Published in: Jul 2023Publisher: PacktISBN-13: 9781837630028

Authors (2)

author image
Raghav Kandarpa

Raghav Kandarpa is an experienced Data Scientist in Finance and logistics industry with expertise in SQL, Python, Building Machine Learning Models, Financial Data Modelling, and Statistical Analysis. He holds a Masters' degree in Business Analytics specializing in Data Science from the University of Texas at Dallas.
Read more about Raghav Kandarpa

author image
Shivangi Saxena

Shivangi Saxena is an experienced BI Engineer with proficiency in SQL, Data Visualization, and Statistical Analysis. She holds a master's degree in Information Technology and Management from the University of Texas at Dallas. She has several years of experience building several BI tools and products using SQL and BI reporting tools which has helped stakeholders to get visibility to the right data points
Read more about Shivangi Saxena