From the course: Querying Microsoft SQL Server 2019

Unlock the full course today

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

Explore data with SUM

Explore data with SUM - SQL Server Tutorial

From the course: Querying Microsoft SQL Server 2019

Start my 1-month free trial

Explore data with SUM

- [Instructor] Aggregate functions are ideal for getting high-level summaries of financial data. That's because in a typical relational database, sales numbers are recorded individually. You might have the total profit for each store recorded on a daily basis. Using aggregate functions, you can find the total profit for the week or the month or for all the stores within the same sales region. To do that, you only need to group your data into different buckets. Let's take a look at the information in the AdventureWorks database that's stored in the SalesOrderDetail table down in the Sales schema. You can find that table right here. If you expand it, you'll see all the different columns, but it's easier to create a query to look at it. I'll write a simple query that just says SELECT * FROM Sales.SalesOrderDetail. In the first column that's returned, I can see that we have a number of rows that all correspond to the same…

Contents