Challenge: Categorize Transactions
After exploring the basics of logical functions and their application in SQL, you are ready to take on a practical challenge that puts your understanding to the test. In real-world scenarios, it is common to categorize transactions by their amount to quickly identify high-value, medium-value, or low-value activities. This kind of classification is particularly useful for business analytics, fraud detection, and reporting.
Swipe to start coding
Write a query to classify each transaction as 'High', 'Medium', or 'Low' based on the value in the amount column.
- Assign the label 'High' if the
amountis greater than or equal to 300. - Assign the label 'Medium' if the
amountis greater than or equal to 100 but less than 300. - Assign the label 'Low' if the
amountis less than 100. - Add this classification as a column called
amount_categoryin the result set.
Oplossing
Bedankt voor je feedback!
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Geweldig!
Completion tarief verbeterd naar 2.86
Challenge: Categorize Transactions
Veeg om het menu te tonen
After exploring the basics of logical functions and their application in SQL, you are ready to take on a practical challenge that puts your understanding to the test. In real-world scenarios, it is common to categorize transactions by their amount to quickly identify high-value, medium-value, or low-value activities. This kind of classification is particularly useful for business analytics, fraud detection, and reporting.
Swipe to start coding
Write a query to classify each transaction as 'High', 'Medium', or 'Low' based on the value in the amount column.
- Assign the label 'High' if the
amountis greater than or equal to 300. - Assign the label 'Medium' if the
amountis greater than or equal to 100 but less than 300. - Assign the label 'Low' if the
amountis less than 100. - Add this classification as a column called
amount_categoryin the result set.
Oplossing
Bedankt voor je feedback!
single