[leetcode数据库12] 620. 有趣的电影
2021/6/19 19:28:36
本文主要是介绍[leetcode数据库12] 620. 有趣的电影,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
leetcode数据库题目,简单题,面试中出现概率约为30%
题目描述:
某城市开了一家新的电影院,吸引了很多人过来看电影。该电影院特别注意用户体验, 专门有个 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 | +---------+-----------+--------------+-----------+ 对于上面的例子,则正确的输出是为: +---------+-----------+--------------+-----------+ | id | movie | description | rating | +---------+-----------+--------------+-----------+ | 5 | House card| Interesting| 9.1 | | 1 | War | great 3D | 8.9 | +---------+-----------+--------------+-----------+ 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/not-boring-movies 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
题目答案:
select id,movie,description,rating from cinema where description <> 'boring' and id%2=1 order by rating desc
知识点:order by
这篇关于[leetcode数据库12] 620. 有趣的电影的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-09-28pyqt 怎么打包整个项目-icode9专业技术文章分享
- 2024-09-28laravel Commands 创建带有参数的 Artisan 命令的步骤和示例-icode9专业技术文章分享
- 2024-09-28antd怎么实现渲染tiff图片-icode9专业技术文章分享
- 2024-09-28英文半角中划线和中文全角的中划线有什么区别-icode9专业技术文章分享
- 2024-09-28nvm npm 和node 他们之间有什么关系-icode9专业技术文章分享
- 2024-09-28Node Version Manager (nvm)使用教程-icode9专业技术文章分享
- 2024-09-28nvm命令太慢,是什么原因-icode9专业技术文章分享
- 2024-09-28Kotlin 如何增加、删除和修改 MutableStateFlow 中的值。-icode9专业技术文章分享
- 2024-09-28Kotlin的stateFlow.update 写法介绍-icode9专业技术文章分享
- 2024-09-28kotlin 怎么获取当前时间格式-icode9专业技术文章分享