Month Over Month
Start Timer
0:00:00
Given a table of transactions and products, write a function to get the month_over_month change in revenue for the year 2019. Make sure to round month_over_month to 2 decimal places.
Example:
Input:
transactions table
| Column | Type |
|---|---|
id |
INTEGER |
user_id |
INTEGER |
created_at |
DATETIME |
product_id |
INTEGER |
quantity |
INTEGER |
products table
| Column | Type |
|---|---|
id |
INTEGER |
name |
VARCHAR |
price |
FLOAT |
Output:
| Column | Type |
|---|---|
month |
INTEGER |
month_over_month |
FLOAT |
.
.
.
.
.
.
.
.
.
Comments