Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Custom KPIs with CASE WHEN | CASE WHEN for Business Logic
SQL for Business Intelligence Analysts

bookChallenge: Custom KPIs with CASE WHEN

Task

Swipe to start coding

Write SQL queries to create custom business metrics using CASE WHEN inside aggregation functions.

  • Return the count of orders that have a status of 'Delivered' as completed_orders.
  • Return the sum of total_amount for all orders where total_amount is greater than 500 as high_value_sales.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 6
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Custom KPIs with CASE WHEN

Swipe to show menu

Task

Swipe to start coding

Write SQL queries to create custom business metrics using CASE WHEN inside aggregation functions.

  • Return the count of orders that have a status of 'Delivered' as completed_orders.
  • Return the sum of total_amount for all orders where total_amount is greater than 500 as high_value_sales.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 6
single

single

some-alt