Challenge: Sales Performance Label
Tâche
Swipe to start coding
Write a query that adds a performance column to the sales table output, labeling each row based on quantity and price:
- If both
quantityis greater than or equal to 50 andpriceis greater than or equal to 100, label as'Top'. - If only one of these conditions is met, label as
'Average'. - Otherwise, label as
'Low'.
Steps:
- Use a
CASE WHENexpression in theSELECTclause to create theperformancecolumn. - Check if both
quantityis greater than or equal to 50 andpriceis greater than or equal to 100. - Check if only one of those conditions is met.
- Label all other rows as
'Low'.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 6
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Génial!
Completion taux amélioré à 4.17
Challenge: Sales Performance Label
Glissez pour afficher le menu
Tâche
Swipe to start coding
Write a query that adds a performance column to the sales table output, labeling each row based on quantity and price:
- If both
quantityis greater than or equal to 50 andpriceis greater than or equal to 100, label as'Top'. - If only one of these conditions is met, label as
'Average'. - Otherwise, label as
'Low'.
Steps:
- Use a
CASE WHENexpression in theSELECTclause to create theperformancecolumn. - Check if both
quantityis greater than or equal to 50 andpriceis greater than or equal to 100. - Check if only one of those conditions is met.
- Label all other rows as
'Low'.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 6
single