Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Handle Missing Employee Data | Advanced CASE WHEN Logic
Mastering CASE WHEN in SQL

bookChallenge: Handle Missing Employee Data

Opgave

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.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 5
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

close

bookChallenge: Handle Missing Employee Data

Stryg for at vise menuen

Opgave

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.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 5
single

single

some-alt