A CASE expression in SQL is used to:
-
A
sort rows by a chosen column
-
B
return different values based on conditions
Correct answer
-
C
create a new table inside the database schema
-
D
join two tables on a common column
Correct answer
B. return different values based on conditions
11 views
Explanation
CASE implements if-then-else logic inside a query, often for conditional labels or buckets.
Reference
Asked in: NTS, PPSC IT, Interviews
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ