678. Conditional salary band — function task 2

DBMS Published Updated 0 Views Verified
Write the MySQL query using appropriate string/date/NULL functions.
Looking for the latest Sarkari Result 2026 updates? Check the latest government exam results, merit lists and result updates on Sarkari Resultess.
Sarkari Resultess
Questions & Answers

Answer & Explanation

4 Answers
Verified

Option A

Compare NULL using = NULL.
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 1
Verified Correct Answer

Option B

SELECT id,name,salary,CASE WHEN salary>=150000 THEN 'High' WHEN salary>=80000 THEN 'Medium' ELSE 'Low' END AS band FROM employees;
Additional Explanation
Correct implementation. Prefer parameterized queries in application code, validate affected rows for UPDATE/DELETE, and use transactions for related writes.
Sarkari Resultess
Editorial Answer 2
Verified

Option C

Use string concatenation without handling NULL values.
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 3
Verified

Option D

Use DELETE for the transformation.
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 4