Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Custom Welcome Messages | Advanced CASE WHEN Logic
Practice
Projects
Quizzes & Challenges
Quiz
Challenges
/
Mastering CASE WHEN in SQL

bookChallenge: Custom Welcome Messages

Compito

Swipe to start coding

Write a query that generates a welcome_message column for each employee in the employees table. The welcome_message should be 'Welcome back, [name]!' if the employee's years_at_company is greater than 1, and 'Welcome, [name]!' otherwise. If the employee's name is NULL, use 'there' in place of the name.

  • Use a CASE WHEN expression to determine the correct greeting based on years_at_company.
  • Use the employee's name value in the message, or substitute 'there' if name is NULL.
  • The resulting column should be named welcome_message.

Soluzione

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 6
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

close

bookChallenge: Custom Welcome Messages

Scorri per mostrare il menu

Compito

Swipe to start coding

Write a query that generates a welcome_message column for each employee in the employees table. The welcome_message should be 'Welcome back, [name]!' if the employee's years_at_company is greater than 1, and 'Welcome, [name]!' otherwise. If the employee's name is NULL, use 'there' in place of the name.

  • Use a CASE WHEN expression to determine the correct greeting based on years_at_company.
  • Use the employee's name value in the message, or substitute 'there' if name is NULL.
  • The resulting column should be named welcome_message.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 6
single

single

some-alt