Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Calculate Percentage Growth | Period-over-Period Comparisons
SQL for Finance and Accounting

bookChallenge: Calculate Percentage Growth

Taak

Swipe to start coding

Write a SQL query to calculate the percentage growth in revenue for each month compared to the previous month.

  • Group the revenue table by month and sum the amount for each month.
  • Use a window function to access the previous month's total revenue for each row.
  • Calculate the percentage growth as the difference between the current and previous month's revenue divided by the previous month's revenue, multiplied by 100.
  • Handle cases where the previous month's revenue is NULL or zero by returning NULL for the percentage growth.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 6
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Calculate Percentage Growth

Veeg om het menu te tonen

Taak

Swipe to start coding

Write a SQL query to calculate the percentage growth in revenue for each month compared to the previous month.

  • Group the revenue table by month and sum the amount for each month.
  • Use a window function to access the previous month's total revenue for each row.
  • Calculate the percentage growth as the difference between the current and previous month's revenue divided by the previous month's revenue, multiplied by 100.
  • Handle cases where the previous month's revenue is NULL or zero by returning NULL for the percentage growth.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 6
single

single

some-alt