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

bookChallenge: Calculate Percentage Growth

Tehtävä

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.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 6
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

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

Pyyhkäise näyttääksesi valikon

Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 6
single

single

some-alt