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 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 |
+---------+-----------+--------------+-----------+ 查询出id为奇数,description不是boring,按rating降序的 MySQL(159ms):
# Write your MySQL query statement below
SELECT id , movie , description , rating
FROM cinema
WHERE id&1 AND description != 'boring'
ORDER BY rating DESC ;
620. Not Boring Movies的更多相关文章
- LeetCode - 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 ...
- 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 ...
- leetcode 620. Not Boring Movies 用where语句判断
https://leetcode.com/problems/not-boring-movies/description/ 不管题目简不简单,现在先熟悉语法. 直接用where语句判断即可,判断奇偶可以 ...
- LeetCode 620. Not Boring Movies (有趣的电影)
题目标签: 题目给了我们一个 cinema 表格, 让我们找出 不无聊的电影,并且id 是奇数的,降序排列. 比较直接简单的,具体看code. Java Solution: Runtime: 149 ...
- [Swift]LeetCode620. 有趣的电影 | Not Boring Movies
SQL架构 Create table If Not Exists cinema (id ), description varchar(), rating , )) Truncate table cin ...
- [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 ...
- All LeetCode Questions List 题目汇总
All LeetCode Questions List(Part of Answers, still updating) 题目汇总及部分答案(持续更新中) Leetcode problems clas ...
- Leetcode中的SQL题目练习(一)
595. Big Countries https://leetcode.com/problems/big-countries/description/ Description name contine ...
- 【sql】leetcode习题 (共 42 题)
[175]Combine Two Tables (2018年11月23日,开始集中review基础) Table: Person +-------------+---------+ | Column ...
随机推荐
- Naming Company CodeForces - 794C
Oleg the client and Igor the analyst are good friends. However, sometimes they argue over little thi ...
- LightOJ 1009 二分图染色+BFS/种类并查集
题意:有两个阵营的人,他们互相敌对,给出互相敌对的人,问同个阵营的人最多有多少个. 思路:可以使用种类并查集写.也可以使用使用二分图染色的写法,由于给定的点并不是连续的,所以排序离散化一下,再进行BF ...
- Cycle Sort
Cycle sort的思想与计数排序太像了,理解了基数排序再看这个会有很大的帮助, 圈排序与计数排序的区别在于圈排序只给那些需要计数的数字计数,先看完文章吧,看完再回来理解这一句话 所谓的圈的定义,我 ...
- iOS 网络请求--- AFNetworing的使用
一.GET请求方式: //1.管理器 AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; ...
- Jmeter-7-在命令行中运行Jmeter.
jmeter -n -t D:\Jmeter_result\Script_baidu.jmx -l D:\Jmeter_result\Script_baidu.txt jmeter -n -t D:\ ...
- CCD和CMOS的差别
单从感光器电子技术上来说,CCD比CMOS更先进,理论成像上有优势,但是最近几年CMOS却发展更好,使得很多高端数码单反采用CMOS传感器,下面来看看CCD和CMOS的技术知识: CCD和CMOS传感 ...
- 剖析 golang 的25个关键字
剖析 golang 的25个关键字 基本在所有语言当中,关键字都是不允许用于自定义的,在Golang中有25个关键字,图示如下: 下面我们逐个解析这25个关键字. var && con ...
- 作为一名前端开发工程师,你必须掌握的WEB模板引擎:Handlebars
作为一名前端开发工程师,你必须掌握的WEB模板引擎:Handlebars 一.为什么需要使用模板引擎? 关于为什么要使用模板引擎,按照我常对学生说的一句话就是:不用重复造轮子.. 简单来说,模板最 ...
- 【洛谷 P3809】 【模板】后缀排序
题目链接 先占个坑,以后再补. \(SA\)的总结肯定是要写的. 等理解地深入一点再补. #include <cstdio> #include <cstring> const ...
- 为什么Javascript有设计缺陷
1. 设计阶段过于仓促 Javascript的设计,其实只用了十天.而且,设计师是为了向公司交差,本人并不愿意这样设计(参见<Javascript诞生记>). 另一方面,这种语言的设计初衷 ...