LeetCode 0620 - Not Boring Movies
Not Boring Movies
Desicription
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.
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.
For example, table cinema:
1 | +---------+-----------+--------------+-----------+ |
For the example above, the output should be:
1 | +---------+-----------+--------------+-----------+ |
Solution
1 | select * from cinema where id % 2 = 1 and description != "boring" order by rating desc; |