SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Conditional Aggregation - Sum by Category

Build mastery in Case Statements with this scenario-based SQL challenge and live execution support.

Problem Statement

Calculate total sales by category with conditional summing: sum all sales for category 'Electronics', but only sales > 5000 for category 'Furniture', and only sales with status 'Completed' for other categories. Group by product category.

Relevant Tables

sales_orders

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: