Given sales, item category, and pricing tables, write a SQL query to calculate the total sales value for each item category and location during a specified period.
Use the period from January 1, 2024 through January 31, 2024, with the start date included and the end date excluded. Calculate sales value as quantity multiplied by the unit price valid on the sale date. Exclude sales without an item category or location.
Output
- One row per item category and location, with columns
item_category, location, and total_sales_value.
- Sort by
item_category ascending, then location ascending.