SQL Functions & CASE · Question 3 · Easy

A CASE expression has no ELSE part, and for some row none of its WHEN conditions is true. What does CASE return for that row?

  1. NULL
  2. 0
  3. An empty string
  4. An error is raised and the query stops
Answer and explanation

Answer: A. NULL

Explanation: A missing ELSE behaves like ELSE NULL. The row is still returned, with NULL in that column.

Previous: Table Student: roll | name | marks 1 | Aarav | 82 2 | Diya | 67 3 | Kabir | 45… · Next: Table Student: roll | name | marks 1 | Aarav | 82 2 | Diya | 67 3 | Kabir | 45…

Practise sql functions & case

Try a fresh set of sql functions & case questions with an explanation after every answer, free and without signing up: SQL Functions & CASE practice. Or sit a full placement mock test.

More sql functions & case questions

More sql practice

UNION, INTERSECT & EXCEPT · Tables, Keys & Constraints · DML & Transactions · SELECT, WHERE & ORDER BY · SQL Joins · Aggregates & GROUP BY · Subqueries & CTEs · Window Functions

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge