mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-12 19:01:47 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,12 +1,33 @@
|
||||
<p>某城市开了一家新的电影院,吸引了很多人过来看电影。该电影院特别注意用户体验,专门有个 LED显示板做电影推荐,上面公布着影评和相关电影描述。</p>
|
||||
<p>表:<code>cinema</code></p>
|
||||
|
||||
<p>作为该电影院的信息部主管,您需要编写一个 SQL查询,找出所有影片描述为<strong>非</strong> <code>boring</code> (不无聊) 的并且<strong> id 为奇数 </strong>的影片,结果请按等级 <code>rating</code> 排列。</p>
|
||||
<pre>
|
||||
+----------------+----------+
|
||||
| Column Name | Type |
|
||||
+----------------+----------+
|
||||
| id | int |
|
||||
| movie | varchar |
|
||||
| description | varchar |
|
||||
| rating | float |
|
||||
+----------------+----------+
|
||||
id 是该表的主键(具有唯一值的列)。
|
||||
每行包含有关电影名称、类型和评级的信息。
|
||||
评级为 [0,10] 范围内的小数点后 2 位浮点数。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p>例如,下表 <code>cinema</code>:</p>
|
||||
<p>编写解决方案,找出所有影片描述为 <strong>非</strong> <code>boring</code> (不无聊) 的并且<strong> id 为奇数 </strong>的影片。</p>
|
||||
|
||||
<p>返回结果按 <code>rating</code> <strong>降序排列</strong>。</p>
|
||||
|
||||
<p>结果格式如下示例。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>
|
||||
+---------+-----------+--------------+-----------+
|
||||
| id | movie | description | rating |
|
||||
+---------+-----------+--------------+-----------+
|
||||
@@ -15,18 +36,14 @@
|
||||
| 3 | irish | boring | 6.2 |
|
||||
| 4 | Ice song | Fantacy | 8.6 |
|
||||
| 5 | House card| Interesting| 9.1 |
|
||||
+---------+-----------+--------------+-----------+
|
||||
</pre>
|
||||
|
||||
<p>对于上面的例子,则正确的输出是为:</p>
|
||||
|
||||
<pre>
|
||||
<strong>+---------+-----------+--------------+-----------+
|
||||
输出:</strong>
|
||||
+---------+-----------+--------------+-----------+
|
||||
| id | movie | description | rating |
|
||||
+---------+-----------+--------------+-----------+
|
||||
| 5 | House card| Interesting| 9.1 |
|
||||
| 1 | War | great 3D | 8.9 |
|
||||
+---------+-----------+--------------+-----------+
|
||||
<strong>解释:</strong>
|
||||
我们有三部电影,它们的 id 是奇数:1、3 和 5。id = 3 的电影是 boring 的,所以我们不把它包括在答案中。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
Reference in New Issue
Block a user