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:

+---------+-----------+--------------+-----------+
| 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 |
+---------+-----------+--------------+-----------+

For the example above, the output should be:

+---------+-----------+--------------+-----------+
| id | movie | description | rating |
+---------+-----------+--------------+-----------+
| 5 | House card| Interesting| 9.1 |
| 1 | War | great 3D | 8.9 |
+---------+-----------+--------------+-----------+
# Write your MySQL query statement below
select * from cinema where description != 'boring' and (id % 2) = 1 group by rating desc

LeetCode - 620. Not Boring Movies的更多相关文章

  1. leetcode 620. Not Boring Movies 用where语句判断

    https://leetcode.com/problems/not-boring-movies/description/ 不管题目简不简单,现在先熟悉语法. 直接用where语句判断即可,判断奇偶可以 ...

  2. LeetCode: 620 Not Boring Movies(easy)

    题目: X city opened a new cinema, many people would like to go to this cinema. The cinema also gives o ...

  3. LeetCode 620. Not Boring Movies (有趣的电影)

    题目标签: 题目给了我们一个 cinema 表格, 让我们找出 不无聊的电影,并且id 是奇数的,降序排列. 比较直接简单的,具体看code. Java Solution: Runtime:  149 ...

  4. [LeetCode] 620. Not Boring Movies_Easy tag: SQL

    X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a ...

  5. 620. Not Boring Movies

    X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a ...

  6. [Swift]LeetCode620. 有趣的电影 | Not Boring Movies

    SQL架构 Create table If Not Exists cinema (id ), description varchar(), rating , )) Truncate table cin ...

  7. All LeetCode Questions List 题目汇总

    All LeetCode Questions List(Part of Answers, still updating) 题目汇总及部分答案(持续更新中) Leetcode problems clas ...

  8. Leetcode中的SQL题目练习(一)

    595. Big Countries https://leetcode.com/problems/big-countries/description/ Description name contine ...

  9. [LeetCode] All questions numbers conclusion 所有题目题号

    Note: 后面数字n表明刷的第n + 1遍, 如果题目有**, 表明有待总结 Conclusion questions: [LeetCode] questions conclustion_BFS, ...

随机推荐

  1. dedesms中的导致生成静态页面多出空白行解决办法

    前几天给朋友用织梦仿一个手机网站,保存处理好的代码,页面头部在浏览里莫名其妙多了一段空白区域,用调试工具查看,发现是代码里多了一行&#65279.后来发现很多网友在生成织梦页面的时候,头部 ...

  2. libJPEG-turbo库使用示例代码

    libJPEG库是用于编码数据为JPEG格式或者解码JPEG格式图片的常用库,OpenCV读取图像底层实现就是利用libJPEG库,而libJPEG-turbo则效率更高. 具体怎么编译编译libJP ...

  3. 【Android】版本的名称

    http://www.cnblogs.com/imlucky/archive/2011/10/21/2220596.html

  4. Java调用阿里云短信通道服务【千锋】

    这里我们使用SpringBoot 来调用阿里通信的服务. 阿里通信,双11.收到短信,日发送达6亿条.保障力度非常高. 使用的步骤: 1.1. 第一步:需要开通账户 1.2. 第二步:阅读接口文档 1 ...

  5. 洛谷 P1078 文化之旅

    P1078 文化之旅 题目描述 有一位使者要游历各国,他每到一个国家,都能学到一种文化,但他不愿意学习任何一种文化超过一次(即如果他学习了某种文化,则他就不能到达其他有这种文化的国家).不同的国家可能 ...

  6. Linuxc - Makefile完成项目的管理。

    Makefile完成项目的管理. root@jiqing-virtual-machine:~/cspace/les2# ls main.c Makefile max.c max.h min.c min ...

  7. HierarchyID 数据类型用法

    树形层次结构(Hierarchy)经常出现在有结构的数据中,T-SQL新增数据类型HierarchyID, 其长度可变,用于存储层次结构中的路径.HierarchyID表示的层次结构是树形的,由应用程 ...

  8. springmvc图片上传(兼容ie8以上,实时预览)

    html代码: <form id="uploadform" method="post" enctype="multipart/form-data ...

  9. 重拾Python(1):使用Anaconda搭建Python开发环境(Windows7)

    1.为什么选择Anaconda? Anaconda解决了Python使用痛点. Python好用但是令人头疼的就是库管理与Python不同版本的问题,特别是Windows环境下. 2.什么是Anaco ...

  10. 几次面试后才弄懂的HashMap

    本人大四,以前也开发过几个项目,Map相关集合也总用.但是从来没有研究过底层的实现,只知道杂用.结果在最开始的几次面试中一脸懵逼.认识到不足后,浅显的学习了一下,总结成一下几点.(如果写错了还望指正) ...