Check out example codes for "case in mysql". It will help you in understanding the concepts better.

Code Example 1

mysql> SELECT CASE  WHEN 2>3 THEN 'this is true' ELSE 'this is false' END; 
+-------------------------------------------------------------+
| CASE  WHEN 2>3 THEN 'this is true' ELSE 'this is false' END |
+-------------------------------------------------------------+
| this is false                                               | 
+-------------------------------------------------------------+

Code Example 2

SELECT OrderID, Quantity,
CASE
    WHEN Quantity > 30 
  THEN "The quantity is greater than 30"
    WHEN Quantity = 
  30 THEN "The quantity is 30"
    ELSE "The quantity is 
  under 30"
END
FROM OrderDetails;

Code Example 3

SELECT 
t2.company_name,
t2.expose_new,
t2.expose_used,
t1.title,
t1.status,
 CASE status
   when 'New' and t2.expose_new = 1 then 1
   when 'New' and t2.expose_new = 2 then 2
   when 'New' and t2.expose_new = 3 then 3
   when 'Used' and t2.expose_used = 1 then 1
   when 'Used' and t2.expose_used = 2 then 2
   when 'Used' and t2.expose_used = 3 then 3
END as expose
FROM `products` t1
join manufacturers t2 on t2.id = t1.seller
where t1.seller = 4238

Code Example 4

SELECT OrderID, Quantity,
CASE
    WHEN Quantity > 30 
  THEN "The quantity is greater than 30"
    WHEN Quantity = 
  30 THEN "The quantity is 30"
    ELSE "The quantity is 
  under 30"
END
FROM OrderDetails;

Learn ReactJs, React Native from akashmittal.com