Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Sales Performance Label | CASE WHEN Basics and Categorization
Mastering CASE WHEN in SQL

bookChallenge: Sales Performance Label

Tâche

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 quantity is greater than or equal to 50 and price is 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 WHEN expression in the SELECT clause to create the performance column.
  • Check if both quantity is greater than or equal to 50 and price is greater than or equal to 100.
  • Check if only one of those conditions is met.
  • Label all other rows as 'Low'.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 6
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Sales Performance Label

Glissez pour afficher le menu

Tâche

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 quantity is greater than or equal to 50 and price is 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 WHEN expression in the SELECT clause to create the performance column.
  • Check if both quantity is greater than or equal to 50 and price is greater than or equal to 100.
  • Check if only one of those conditions is met.
  • Label all other rows as 'Low'.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 6
single

single

some-alt