Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Categorize Transactions | Logical Functions
Functions in SQL

bookChallenge: 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.

Tarea

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 amount is greater than or equal to 300.
  • Assign the label 'Medium' if the amount is greater than or equal to 100 but less than 300.
  • Assign the label 'Low' if the amount is less than 100.
  • Add this classification as a column called amount_category in the result set.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 2
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

close

bookChallenge: Categorize Transactions

Desliza para mostrar el menú

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.

Tarea

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 amount is greater than or equal to 300.
  • Assign the label 'Medium' if the amount is greater than or equal to 100 but less than 300.
  • Assign the label 'Low' if the amount is less than 100.
  • Add this classification as a column called amount_category in the result set.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 2
single

single

some-alt