Challenge: Sales Performance Label
Oppgave
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 6
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Fantastisk!
Completion rate forbedret til 4.17
Challenge: Sales Performance Label
Sveip for å vise menyen
Oppgave
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 6
single