題目
某城市開了一家新的電影院,吸引了很多人過來看電影。該電影院特别注意使用者體驗,專門有個 LED顯示闆做電影推薦,上面公布着影評和相關電影描述。
作為該電影院的資訊部主管,您需要編寫一個 SQL查詢,找出所有影片描述為非 boring (不無聊) 的并且 id 為奇數 的影片,結果請按等級 rating 排列。
例如,下表 cinema:
id | movie | description | rating |
---|---|---|---|
1 | War | great 3D | 8.9 |
2 | Science | fiction | 8.5 |
3 | irish | boring | 6.2 |
4 | Ice song | Fantacy | 8.6 |
5 | House card | Interesting | 9.1 |
對于上面的例子,則正确的輸出是為:
解答
# Write your MySQL query statement below
select id,movie,description,rating
from cinema where id % 2 =1 and description != 'boring'
order by rating desc
按要求寫即可