Skip to content

Commit 041bef3

Browse files
refactor 620
1 parent ec92b18 commit 041bef3

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

Diff for: database/_620.sql

-25
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
--620. Not Boring Movies
2-
--X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a poster indicating the movies’ ratings and descriptions.
3-
--Please write a SQL query to output movies with an odd numbered ID and a description that is not 'boring'. Order the result by rating.
4-
--
5-
--
6-
--
7-
--For example, table cinema:
8-
--
9-
--+---------+-----------+--------------+-----------+
10-
--| id | movie | description | rating |
11-
--+---------+-----------+--------------+-----------+
12-
--| 1 | War | great 3D | 8.9 |
13-
--| 2 | Science | fiction | 8.5 |
14-
--| 3 | irish | boring | 6.2 |
15-
--| 4 | Ice song | Fantacy | 8.6 |
16-
--| 5 | House card| Interesting| 9.1 |
17-
--+---------+-----------+--------------+-----------+
18-
--For the example above, the output should be:
19-
--+---------+-----------+--------------+-----------+
20-
--| id | movie | description | rating |
21-
--+---------+-----------+--------------+-----------+
22-
--| 5 | House card| Interesting| 9.1 |
23-
--| 1 | War | great 3D | 8.9 |
24-
--+---------+-----------+--------------+-----------+
25-
261
select id, movie, description, rating
272
from cinema where mod (id, 2) = 1
283
and description not like 'boring'

0 commit comments

Comments
 (0)