Loading...
Monthly Cloud Cost Forecast Error
A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- hard
- Seniority
- mid, senior
Problem
We want a naive forecast model for monthly cloud costs. Sum cloud cost amounts at a monthly level. Use the previous month's total as the forecast for the current month, then calculate the absolute percentage error versus actual. Show year-month, actual cost, forecasted cost, and percentage error.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.