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

bookChallenge: Advanced Business Logic

Aufgabe

Swipe to start coding

Classify each order using both region and total_amount by writing a SQL query with nested and multiple CASE WHEN statements. Follow these rules:

  • If the region is "Europe" and the total_amount is greater than 100, assign the label 'Priority';
  • Otherwise, if the total_amount is greater than 200, assign the label 'High Value';
  • All other orders should be labeled as 'Regular'.

Use a nested CASE WHEN structure to demonstrate your understanding. Return the columns: order_id, region_name, and the label as order_label.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 4
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

bookChallenge: Advanced Business Logic

Swipe um das Menü anzuzeigen

Aufgabe

Swipe to start coding

Classify each order using both region and total_amount by writing a SQL query with nested and multiple CASE WHEN statements. Follow these rules:

  • If the region is "Europe" and the total_amount is greater than 100, assign the label 'Priority';
  • Otherwise, if the total_amount is greater than 200, assign the label 'High Value';
  • All other orders should be labeled as 'Regular'.

Use a nested CASE WHEN structure to demonstrate your understanding. Return the columns: order_id, region_name, and the label as order_label.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 4
single

single

some-alt