SQL: Monthly Revenue Growth

Medium
SQL — Window Functions SQL LAG Growth
Calculate month-over-month revenue growth.

Constraints

Write standard SQL (MySQL 8.0 compatible).

Examples

Example 1:
Input: month revenue 1 1000 2 1200 3 900
Output:
Example 2:
Input: month revenue 1 1000 2 1200 3 900
Output:

Hints

LAG window function.
▲ Console

Install Talent Arabia

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