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

Write a query to calculate year-to-date sales for 2024 grouped by month. Return year, month, monthly_sales, and ytd_sales (cumulative).

Relevant Tables

orders

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: