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
From the course: CompTIA Data+ (DA0-002) Cert Prep
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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Structured query language3m 41s
-
SELECT statement2m 27s
-
(Locked)
Sorting results4m 3s
-
(Locked)
Filtering data4m 1s
-
(Locked)
NULL values3m 26s
-
(Locked)
Aggregating data3m 8s
-
(Locked)
Grouping data3m 7s
-
(Locked)
String manipulation2m 43s
-
(Locked)
Working with dates2m 14s
-
(Locked)
Derived values3m 16s
-
(Locked)
Set operations5m 37s
-
(Locked)
Join operations1m 58s
-
(Locked)
Inner joins7m 7s
-
(Locked)
Joining multiple tables6m 34s
-
(Locked)
Outer joins2m 55s
-
(Locked)
Nested queries2m 17s
-
(Locked)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-