diff --git a/SQL Deep Dive/Conditional Statements/questions.sql b/SQL Deep Dive/Conditional Statements/questions.sql index 13761af..51c01f0 100644 --- a/SQL Deep Dive/Conditional Statements/questions.sql +++ b/SQL Deep Dive/Conditional Statements/questions.sql @@ -5,3 +5,11 @@ * 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, + CASE + when price > 20 THEN 'expensive' + when price > 10 and price <= 20 then 'average' + WHEN price <= 10 then 'cheap' + end as price_class +FROM products +