From the course: From Excel to SQL

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

AVERAGE, MIN, MAX, and COUNT in SQL

AVERAGE, MIN, MAX, and COUNT in SQL

From the course: From Excel to SQL

Start my 1-month free trial

AVERAGE, MIN, MAX, and COUNT in SQL

- When working with numbers in a database, SQL provides some useful functions. Let's take a look at a few of the most popular ones that might come in handy as you're analyzing your data. You've likely come across the average function in Excel. This will calculate the numerical average of a collection of numbers. So you might use this to calculate something like, the average test scores, or in sales, the average number of deals per month. In our example spreadsheet, let's use average to calculate the average number of vacation days taken by our employees. So to do that, I'm going to scroll to the bottom of the vacation column, and then type =average G2:G101. And then you can see the average number of vacation days taken. Let's hop over to DB Browser to check out the equivalent in SQL. For example, let's create a new query that's going to find the average number of vacation days for our employees just like we did in…

Contents