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

bookChallenge: Sales Performance Label

Tehtävä

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

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 6
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

bookChallenge: Sales Performance Label

Pyyhkäise näyttääksesi valikon

Tehtävä

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

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 6
single

single

some-alt