Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SQL question: Write a SQL query that gets each month's rolling sum of the transaction amount for each store over the past year. The original
SQL question:
Write a SQL query that gets each month's rolling sum of the transaction amount for each store over the past year.
The original table (table name is "table") looks like this:
A D 1 StorelD 2 A 3 A 4. A B Date monthly_amt 201901 100 201902 105 201903 99 201904 180 5 A 6 A 7 A 300 201905 201906 201907 700 8 A 900 9 A 201908 4500 10 A 201909 80 11 A 201910 500 700 12 A 13 A 14 B 201911 201912 60 201901 777 15 B 201902 109 400 16 B 17 B 201903 201904 201905 700 500 201906 300 18 B 19 B 20 B 21 B 22 B 99 201907 201908 201909 66 300 201910 201911 50 7900 23 B 24 B 25 B 26 27 201912 500Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started