SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Calculate Year-To-Date (YTD) Sales by Month

Build mastery in Date Operations with this scenario-based SQL challenge and live execution support.

Problem Statement

For calendar year 2024, show each month's sales and the running year-to-date total. Return year, month, monthly_sales, ytd_sales — ordered by year, month.

Relevant Tables

orders

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: