Loading lesson path
Concept visual
Start at both ends
❮ SQL Keywords
command is used is to create different output based on conditions. The following SQL goes through several conditions and returns a value when the specified condition is met:
SELECT OrderID, Quantity,
Formula
WHEN Quantity > 30WHEN Quantity = 30 THEN 'The quantity is 30'
FROM OrderDetails;The following SQL will order the customers by City. However, if City is NULL, then order by Country:
SELECT CustomerName, City, Country
(CASE
END);❮ SQL Keywords