Database - Advanced SQL - Discussion

Discussion Forum : Advanced SQL - General Questions (Q.No. 4)
A CASE SQL statement is which of the following?
A way to establish an IF-THEN-ELSE in SQL.
A way to establish a loop in SQL.
A way to establish a data definition in SQL.
All of the above.
Answer: Option
No answer description is available. Let's discuss.
6 comments Page 1 of 1.

Rakesh said:   5 years ago
In this, we can able to write both if and else conditions ;

WHEN Gender = 'M' THEN 'Male'
WHEN Gender = 'F' THEN 'Female'
ELSE 'Unknown Value'
FROM Employee.

Amulya said:   5 years ago
Please explain, if-then_else in sql with an example.

Sanjay said:   6 years ago
But we can use fun.UCase or LCase. Am I right?

Hari krishna dondapati said:   1 decade ago
It is nothing but, it will checks the equality condition like where clause in normal select statement.

If value is true, then it will display corresponding value.

AbinayaRavi said:   1 decade ago
This is like switch cases but used in if-then-else.

Kaushiki singh said:   1 decade ago
I got ucase and lcase but do not understand this case sql, how it establish if-then-else- in sql ?

Post your comments here:

Your comments will be displayed after verification.