We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eec73c5 commit a469417Copy full SHA for a469417
SQL Deep Dive/Conditional Statements/questions.sql
@@ -5,15 +5,11 @@
5
* if it's between 10 and 20 you show 'average'
6
* and of is lower than or equal to 10 you show 'cheap'.
7
*/
8
-SELECT
9
- p.prod_id,
10
- p.title,
11
- p.price,
12
- CASE
13
- WHEN p.price > 20 THEN 'expensive'
14
- WHEN p.price BETWEEN 10 AND 20 THEN 'average'
15
- ELSE 'cheap'
16
- END AS price_class
17
-FROM products AS p
+select p.prod_id, p.title, p.price,
+ CASE
+ WHEN p.price > 20 THEN 'expensive'
+ WHEN p.price between 10 AND 20 then 'average'
+ ELSE 'cheap'
+ END AS "price class"
+FROM productS as p
18
ORDER BY p.price DESC;
19
-
0 commit comments