Interview Query

Month Over Month

Upvote
21
Downvote
Save
Mark Completed
Have you seen this question before?

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
Next question: t Value via Pandas
.....
Loading editor
Use Shift + Enter to run

Comments

Loading comments