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

bookChallenge: Custom KPIs with CASE WHEN

Opgave

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.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 6
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

close

bookChallenge: Custom KPIs with CASE WHEN

Stryg for at vise menuen

Opgave

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.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 6
single

single

some-alt