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

bookChallenge: Sales Performance Label

Taak

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'.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 6
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

close

bookChallenge: Sales Performance Label

Veeg om het menu te tonen

Taak

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'.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 6
single

single

some-alt