Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Custom Welcome Messages | Advanced CASE WHEN Logic
Mastering CASE WHEN in SQL

bookChallenge: Custom Welcome Messages

Завдання

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.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 6
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

close

bookChallenge: Custom Welcome Messages

Свайпніть щоб показати меню

Завдання

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.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 6
single

single

some-alt