Skip to content

Commit a469417

Browse files
authored
Update questions.sql
1 parent eec73c5 commit a469417

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

SQL Deep Dive/Conditional Statements/questions.sql

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@
55
* if it's between 10 and 20 you show 'average'
66
* and of is lower than or equal to 10 you show 'cheap'.
77
*/
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
8+
select p.prod_id, p.title, p.price,
9+
CASE
10+
WHEN p.price > 20 THEN 'expensive'
11+
WHEN p.price between 10 AND 20 then 'average'
12+
ELSE 'cheap'
13+
END AS "price class"
14+
FROM productS as p
1815
ORDER BY p.price DESC;
19-

0 commit comments

Comments
 (0)