⌘K
Flycodx

SQL Window Functions: Running Totals and Moving Averages

SQL Window Functions: Running Totals and Moving Averages

MediumSQL0% accepted

Use window functions to compute running total of sales per customer, moving 3-day average of daily sales, and rank products by revenue within each category.

Approach

Use window functions for running totals, moving averages, and ranking.

Input

Customer orders: 100, 200, 150 on Jan1,Jan2,Jan3

Output

Running total: 100, 300, 450

Scenarios & Expected Answers

Sign in to continue

Create a free account to view answers and mark progress.

  • Free forever — no credit card
  • Theory Q&A with detailed answers
  • Points, streaks & leaderboards
Auto Save On