diff --git a/SQL Deep Dive/Conditional Statements/questions.sql b/SQL Deep Dive/Conditional Statements/questions.sql index 13761af..7fe98bd 100644 --- a/SQL Deep Dive/Conditional Statements/questions.sql +++ b/SQL Deep Dive/Conditional Statements/questions.sql @@ -5,3 +5,10 @@ * if it's between 10 and 20 you show 'average' * and of is lower than or equal to 10 you show 'cheap'. */ +SELECT prod_id, title, price +CASE + WHEN price > 20 THEN "expensive" + WHEN price BETWEEN 10 AND 20 THEN "average" + WHEN price <= 10 THEN "cheap" +END AS "price class" +FROM products