DP-203 · Question #148
Drag and Drop Question You have the following table named Employees. You need to calculate the employee_type value based on the hire_date value. How should you complete the Transact-SQL statement?…
The correct answer is CASE; ELSE. The CASE expression is the correct T-SQL construct for implementing conditional logic to derive the employee_type value based on hire_date, using WHEN/THEN clauses to evaluate conditions. The ELSE keyword is required as the final clause in a CASE expression to handle any rows…
Question
Exhibit
Answer Area
Drag items
Correct arrangement
- CASE
- ELSE
Explanation
The CASE expression is the correct T-SQL construct for implementing conditional logic to derive the employee_type value based on hire_date, using WHEN/THEN clauses to evaluate conditions. The ELSE keyword is required as the final clause in a CASE expression to handle any rows that don't match the preceding WHEN conditions, providing a default value. Together, CASE...WHEN...THEN...ELSE...END forms the complete conditional expression needed to categorize employees based on their hire date.
Topics
Community Discussion
No community discussion yet for this question.
