From the course: CompTIA Data+ (DA0-002) Cert Prep

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Aggregating data

Aggregating data

- [Narrator] One of the common things we do when we work with a dataset, is summarize data in one way or another. We might want to find our most valuable customer, the average age of our workforce, or the order that generated our highest profit margin. Aggregate functions allow us to summarize data across a dataset. We write our query to identify a set of records, but instead of simply displaying those records, we ask for a summary of the records using an aggregate function that returns a single value, such as a COUNT or an average. We'll look at five different aggregate functions. The first, COUNT simply identifies the number of rows in a dataset or a subset of that dataset. Let's try counting records in SQL. To do this, I use the COUNT aggregate function. I'm going to begin by simply counting how many employees are in our dataset. I'm going to select that COUNT from my HumanResources.Employee table. All this query is doing, is telling the database to count the number of records in…

Contents