Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Calculate Percentage Growth | Period-over-Period Comparisons
SQL for Finance and Accounting

bookChallenge: Calculate Percentage Growth

Завдання

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.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 6
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

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

Свайпніть щоб показати меню

Завдання

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.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 6
single

single

some-alt