Challenge: Sales Performance Label
Uppgift
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'.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 6
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Fantastiskt!
Completion betyg förbättrat till 4.17
Challenge: Sales Performance Label
Svep för att visa menyn
Uppgift
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'.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 6
single