Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3960753

Browse files
committed
add 620
1 parent e716a84 commit 3960753

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

620-not_boring_movies.sql

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
-- 620. Not Boring Movies
22

3-
"hello"
3+
-- 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.
4+
-- 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.
5+
6+
-- For example, table cinema:
7+
8+
-- +---------+-----------+--------------+-----------+
9+
-- | id | movie | description | rating |
10+
-- +---------+-----------+--------------+-----------+
11+
-- | 1 | War | great 3D | 8.9 |
12+
-- | 2 | Science | fiction | 8.5 |
13+
-- | 3 | irish | boring | 6.2 |
14+
-- | 4 | Ice song | Fantacy | 8.6 |
15+
-- | 5 | House card| Interesting| 9.1 |
16+
-- +---------+-----------+--------------+-----------+
17+
-- For the example above, the output should be:
18+
-- +---------+-----------+--------------+-----------+
19+
-- | id | movie | description | rating |
20+
-- +---------+-----------+--------------+-----------+
21+
-- | 5 | House card| Interesting| 9.1 |
22+
-- | 1 | War | great 3D | 8.9 |
23+
-- +---------+-----------+--------------+-----------+
24+
25+
SELECT * FROM cinema
26+
WHERE Mod(id,2 )<> 0 and NOT description = "boring"
27+
ORDER BY rating DESC;

0 commit comments

Comments
 (0)