1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate SQL Server

Connected

Exercise

Window functions with aggregations (I)

To familiarize yourself with the window functions, you will work with the Orders table in this chapter. Recall that using OVER(), you can create a window for the entire table. To create partitions using a specific column, you need to use OVER() along with PARTITION BY.

Instructions

100 XP

Write a T-SQL query that returns the sum of OrderPrice by creating partitions for each TerritoryName.