Long or short
#008BasicCASE4 min
The cinema wants a small tag on each movie in the schedule: 'long' if minutes is over 100, 'short' otherwise. Pick each movie's title and its tag.
The tablesmovies| id | title | genre | minutes | rating |
|---|
| 1 | Robot Summer | family | 95 | 8 |
| 2 | Dark Lake | horror | 110 | 6 |
| 3 | Space Pals | family | 88 | 7 |
| 4 | The Long Road | drama | 142 | 9 |
| 5 | Laugh Track | comedy | 101 | 5 |
| 6 | Snow Day | comedy | 92 | 7 |
6 rows
tickets| id | movie_id | day | seats | price |
|---|
| 1 | 1 | Fri | 2 | 40 |
| 2 | 1 | Sat | 4 | 80 |
| 3 | 2 | Fri | 1 | 25 |
| 4 | 3 | Sat | 3 | 54 |
| 5 | 4 | Sun | 2 | 60 |
| 6 | 1 | Sun | 1 | 20 |
| 7 | 5 | Sat | 2 | 36 |
| 8 | 3 | Sun | 5 | 90 |
8 rows
movies| id | title | genre | minutes | rating |
|---|
| 1 | Robot Summer | family | 95 | 8 |
| 2 | Dark Lake | horror | 110 | 6 |
| 3 | Space Pals | family | 88 | 7 |
| 4 | The Long Road | drama | 142 | 9 |
| 5 | Laugh Track | comedy | 101 | 5 |
| 6 | Snow Day | comedy | 92 | 7 |
6 rows
tickets| id | movie_id | day | seats | price |
|---|
| 1 | 1 | Fri | 2 | 40 |
| 2 | 1 | Sat | 4 | 80 |
| 3 | 2 | Fri | 1 | 25 |
| 4 | 3 | Sat | 3 | 54 |
| 5 | 4 | Sun | 2 | 60 |
| 6 | 1 | Sun | 1 | 20 |
| 7 | 5 | Sat | 2 | 36 |
| 8 | 3 | Sun | 5 | 90 |
8 rows
query.sql
SELECT title,
CASE
-- your code here: WHEN minutes > 100 THEN 'long', and ELSE 'short' for the rest
END
FROM movies;
Ctrl + Enter runs too
Result
Run shows what your query gives. When it looks right, Submit.