Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Sales Performance Label | CASE WHEN Basics and Categorization
Practice
Projects
Quizzes & Challenges
Quizze
Challenges
/
Mastering CASE WHEN in SQL

bookChallenge: Sales Performance Label

Aufgabe

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

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 6
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

bookChallenge: Sales Performance Label

Swipe um das Menü anzuzeigen

Aufgabe

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

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 6
single

single

some-alt