Challenge: Categorize Sales Volume
Task
Swipe to start coding
Write a query that selects all columns from the sales table and adds a new column named volume_category. The value of volume_category should be determined by the following rules:
- If
quantityis greater than or equal to 100, setvolume_categoryto'Bulk'. - If
quantityis greater than or equal to 20 but less than 100, setvolume_categoryto'Standard'. - If
quantityis less than 20, setvolume_categoryto'Small'.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 2
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 4.17
Challenge: Categorize Sales Volume
Swipe to show menu
Task
Swipe to start coding
Write a query that selects all columns from the sales table and adds a new column named volume_category. The value of volume_category should be determined by the following rules:
- If
quantityis greater than or equal to 100, setvolume_categoryto'Bulk'. - If
quantityis greater than or equal to 20 but less than 100, setvolume_categoryto'Standard'. - If
quantityis less than 20, setvolume_categoryto'Small'.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 2
single