Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Handle Missing Employee Data | Advanced CASE WHEN Logic
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Mastering CASE WHEN in SQL

bookChallenge: Handle Missing Employee Data

Task

Swipe to start coding

Write a query that returns all columns from the employees table, along with a new column named data_status. This column should contain the value 'Complete' if all fields (name, department, salary, years_at_company) for the employee are not NULL, and 'Incomplete' if any of these fields are NULL.

  • Add a column called data_status to the result set.
  • Set data_status to 'Complete' if name, department, salary, and years_at_company are all not NULL.
  • Set data_status to 'Incomplete' if any of these fields are NULL.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 5
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Handle Missing Employee Data

Swipe to show menu

Task

Swipe to start coding

Write a query that returns all columns from the employees table, along with a new column named data_status. This column should contain the value 'Complete' if all fields (name, department, salary, years_at_company) for the employee are not NULL, and 'Incomplete' if any of these fields are NULL.

  • Add a column called data_status to the result set.
  • Set data_status to 'Complete' if name, department, salary, and years_at_company are all not NULL.
  • Set data_status to 'Incomplete' if any of these fields are NULL.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 5
single

single

some-alt