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

bookChallenge: Advanced Business Logic

Tâche

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.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 4
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Advanced Business Logic

Glissez pour afficher le menu

Tâche

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.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 4
single

single

some-alt