Challenge: Advanced Business Logic
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_amountis 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.
Ratkaisu
Kiitos palautteestasi!
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 5.56
Challenge: Advanced Business Logic
Pyyhkäise näyttääksesi valikon
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_amountis 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.
Ratkaisu
Kiitos palautteestasi!
single