SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Nested CASE - Classify Sales with Discount by Customer Type

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

Problem Statement

Compute discount_percentage for every sale using a nested CASE: High value (sale_amount > 100000) → Corporate 20, Government 18, Individual 15. Medium value (50000-100000 inclusive) → Corporate 15, all other types 10. Everything else (< 50000) → 5. Return sale_id, sale_amount, customer_type, discount_percentage — ordered by sale_id.

Relevant Tables

sales

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: