mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-27 02:30:28 +08:00
84 lines
8.1 KiB
JSON
84 lines
8.1 KiB
JSON
{
|
||
"data": {
|
||
"question": {
|
||
"questionId": "620",
|
||
"questionFrontendId": "620",
|
||
"categoryTitle": "Database",
|
||
"boundTopicId": 1258,
|
||
"title": "Not Boring Movies",
|
||
"titleSlug": "not-boring-movies",
|
||
"content": "<p>Table: <code>Cinema</code></p>\n\n<pre>\n+----------------+----------+\n| Column Name | Type |\n+----------------+----------+\n| id | int |\n| movie | varchar |\n| description | varchar |\n| rating | float |\n+----------------+----------+\nid is the primary key for this table.\nEach row contains information about the name of a movie, its genre, and its rating.\nrating is a 2 decimal places float in the range [0, 10]\n</pre>\n\n<p> </p>\n\n<p>Write an SQL query to report the movies with an odd-numbered ID and a description that is not <code>"boring"</code>.</p>\n\n<p>Return the result table ordered by <code>rating</code> <strong>in descending order</strong>.</p>\n\n<p>The query result format is in the following example.</p>\n\n<p> </p>\n<p><strong>Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nCinema table:\n+----+------------+-------------+--------+\n| id | movie | description | rating |\n+----+------------+-------------+--------+\n| 1 | War | great 3D | 8.9 |\n| 2 | Science | fiction | 8.5 |\n| 3 | irish | boring | 6.2 |\n| 4 | Ice song | Fantacy | 8.6 |\n| 5 | House card | Interesting | 9.1 |\n+----+------------+-------------+--------+\n<strong>Output:</strong> \n+----+------------+-------------+--------+\n| id | movie | description | rating |\n+----+------------+-------------+--------+\n| 5 | House card | Interesting | 9.1 |\n| 1 | War | great 3D | 8.9 |\n+----+------------+-------------+--------+\n<strong>Explanation:</strong> \nWe have three movies with odd-numbered IDs: 1, 3, and 5. The movie with ID = 3 is boring so we do not include it in the answer.\n</pre>\n",
|
||
"translatedTitle": "有趣的电影",
|
||
"translatedContent": "<p>某城市开了一家新的电影院,吸引了很多人过来看电影。该电影院特别注意用户体验,专门有个 LED显示板做电影推荐,上面公布着影评和相关电影描述。</p>\n\n<p>作为该电影院的信息部主管,您需要编写一个 SQL查询,找出所有影片描述为<strong>非</strong> <code>boring</code> (不无聊) 的并且<strong> id 为奇数 </strong>的影片,结果请按等级 <code>rating</code> 排列。</p>\n\n<p> </p>\n\n<p>例如,下表 <code>cinema</code>:</p>\n\n<pre>\n+---------+-----------+--------------+-----------+\n| id | movie | description | rating |\n+---------+-----------+--------------+-----------+\n| 1 | War | great 3D | 8.9 |\n| 2 | Science | fiction | 8.5 |\n| 3 | irish | boring | 6.2 |\n| 4 | Ice song | Fantacy | 8.6 |\n| 5 | House card| Interesting| 9.1 |\n+---------+-----------+--------------+-----------+\n</pre>\n\n<p>对于上面的例子,则正确的输出是为:</p>\n\n<pre>\n+---------+-----------+--------------+-----------+\n| id | movie | description | rating |\n+---------+-----------+--------------+-----------+\n| 5 | House card| Interesting| 9.1 |\n| 1 | War | great 3D | 8.9 |\n+---------+-----------+--------------+-----------+\n</pre>\n\n<p> </p>\n",
|
||
"isPaidOnly": false,
|
||
"difficulty": "Easy",
|
||
"likes": 149,
|
||
"dislikes": 0,
|
||
"isLiked": null,
|
||
"similarQuestions": "[]",
|
||
"contributors": [],
|
||
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false}",
|
||
"topicTags": [
|
||
{
|
||
"name": "Database",
|
||
"slug": "database",
|
||
"translatedName": "数据库",
|
||
"__typename": "TopicTagNode"
|
||
}
|
||
],
|
||
"companyTagStats": null,
|
||
"codeSnippets": [
|
||
{
|
||
"lang": "MySQL",
|
||
"langSlug": "mysql",
|
||
"code": "# Write your MySQL query statement below",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "MS SQL Server",
|
||
"langSlug": "mssql",
|
||
"code": "/* Write your T-SQL query statement below */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Oracle",
|
||
"langSlug": "oraclesql",
|
||
"code": "/* Write your PL/SQL query statement below */",
|
||
"__typename": "CodeSnippetNode"
|
||
}
|
||
],
|
||
"stats": "{\"totalAccepted\": \"109K\", \"totalSubmission\": \"141.1K\", \"totalAcceptedRaw\": 108981, \"totalSubmissionRaw\": 141138, \"acRate\": \"77.2%\"}",
|
||
"hints": [],
|
||
"solution": {
|
||
"id": "95",
|
||
"canSeeDetail": true,
|
||
"__typename": "ArticleNode"
|
||
},
|
||
"status": null,
|
||
"sampleTestCase": "{\"headers\":{\"cinema\":[\"id\", \"movie\", \"description\", \"rating\"]},\"rows\":{\"cinema\":[[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]]}}",
|
||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists cinema (id int, movie varchar(255), description varchar(255), rating float(2, 1))\"\n ],\n \"mssql\": [\n \"Create table cinema (id int, movie varchar(255), description varchar(255), rating decimal(2, 1))\"\n ],\n \"oraclesql\": [\n \"Create table cinema (id int, movie varchar(255), description varchar(255), rating number(2, 1))\"\n ],\n \"database\": true\n}",
|
||
"judgerAvailable": true,
|
||
"judgeType": "large",
|
||
"mysqlSchemas": [
|
||
"Create table If Not Exists cinema (id int, movie varchar(255), description varchar(255), rating float(2, 1))",
|
||
"Truncate table cinema",
|
||
"insert into cinema (id, movie, description, rating) values ('1', 'War', 'great 3D', '8.9')",
|
||
"insert into cinema (id, movie, description, rating) values ('2', 'Science', 'fiction', '8.5')",
|
||
"insert into cinema (id, movie, description, rating) values ('3', 'irish', 'boring', '6.2')",
|
||
"insert into cinema (id, movie, description, rating) values ('4', 'Ice song', 'Fantacy', '8.6')",
|
||
"insert into cinema (id, movie, description, rating) values ('5', 'House card', 'Interesting', '9.1')"
|
||
],
|
||
"enableRunCode": true,
|
||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"]}",
|
||
"book": null,
|
||
"isSubscribed": false,
|
||
"isDailyQuestion": false,
|
||
"dailyRecordStatus": null,
|
||
"editorType": "CKEDITOR",
|
||
"ugcQuestionId": null,
|
||
"style": "LEETCODE",
|
||
"exampleTestcases": "{\"headers\":{\"cinema\":[\"id\", \"movie\", \"description\", \"rating\"]},\"rows\":{\"cinema\":[[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]]}}",
|
||
"__typename": "QuestionNode"
|
||
}
|
||
}
|
||
} |