From the course: SQL for Data Analysis

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Common SQL aggregate functions

Common SQL aggregate functions - SQL Tutorial

From the course: SQL for Data Analysis

Common SQL aggregate functions

- [Instructor] Now let's look at the many mathematical functions we have available in SQL to translate our data into some meaningful information. Some common aggregate functions include count, average, min, max, and sum. Count is a commonly used function within SQL to find the frequency of values in a data set. For example, we may want to know how many customers we have. We can perform that calculation in the Count Customers.sql file. Let's take a look at that syntax, which should be familiar. Let's run this query. This query will return the number of customers in our database. Here, we see that we have a thousand customers in our database. We can also count the number of customers that have made purchases by counting the number of customer IDs in the order table. Let's go to Count Orders.sql. Run this query, I get a count of 200. However, we know that customers can make more than one order, so that will not give…

Contents