77

Cumulative Order Amount

Hardwindow functionSUM OVER

Problem Description

Write a SQL query to show each order with a running total of amounts.

Expected Columns

  • id
  • order_date
  • amount
  • running_total

Example Output

| id | order_date | amount | running_total | |----|------------|--------|---------------| | 1 | 2023-01-20 | 76500.0 | 76500.0 | | 2 | 2023-01-25 | 8850.0 | 85350.0 | | 3 | 2023-02-01 | 4500.0 | 89850.0 | | ... | ... | ... | ... |

Hints

Unlocks after 2 more attempts
Submit your solution to unlock hints
//#77 Cumulative Order Amount
Hard

Loading schema...

Loading editor...

No results yet

Run a query to see results