Challenge: Month-over-Month Revenue Growth
Opgave
Swipe to start coding
- Write a SQL query that calculates the revenue for each month using the
revenuetable. - For each month, also compute the change in revenue compared to the previous month.
- Your result should include the following columns:
- The month (as the first day of the month)
- The total revenue for that month
- The change in revenue compared to the previous month (can be
NULLfor the first month)
- Use a window function to compare each month to its previous month.
- Do not repeat or copy the code samples already provided in the chapter.
- Order the results by month in ascending order.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 2
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Suggested prompts:
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Fantastisk!
Completion rate forbedret til 4.55
Challenge: Month-over-Month Revenue Growth
Stryg for at vise menuen
Opgave
Swipe to start coding
- Write a SQL query that calculates the revenue for each month using the
revenuetable. - For each month, also compute the change in revenue compared to the previous month.
- Your result should include the following columns:
- The month (as the first day of the month)
- The total revenue for that month
- The change in revenue compared to the previous month (can be
NULLfor the first month)
- Use a window function to compare each month to its previous month.
- Do not repeat or copy the code samples already provided in the chapter.
- Order the results by month in ascending order.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 2
single