SQL: Running Total

Medium
SQL — Window Functions SQL Running Total OVER
Calculate running total of sales.

Constraints

Write standard SQL (MySQL 8.0 compatible).

Examples

Example 1:
Input: date amount 1 100 2 200 3 150
Output:
Example 2:
Input: date amount 1 100 2 200 3 150
Output:

Hints

SUM() OVER(ORDER BY date).
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.