1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-21 04:56:46 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
leetcode-problemset/leetcode-cn/originData/find-books-with-polarized-opinions.json
2025-09-29 14:43:44 +08:00

107 lines
25 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"data": {
"question": {
"questionId": "3996",
"questionFrontendId": "3642",
"categoryTitle": "Database",
"boundTopicId": 3745957,
"title": "Find Books with Polarized Opinions",
"titleSlug": "find-books-with-polarized-opinions",
"content": "<p>Table: <code>books</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| book_id | int |\n| title | varchar |\n| author | varchar |\n| genre | varchar |\n| pages | int |\n+-------------+---------+\nbook_id is the unique ID for this table.\nEach row contains information about a book including its genre and page count.\n</pre>\n\n<p>Table: <code>reading_sessions</code></p>\n\n<pre>\n+----------------+---------+\n| Column Name | Type |\n+----------------+---------+\n| session_id | int |\n| book_id | int |\n| reader_name | varchar |\n| pages_read | int |\n| session_rating | int |\n+----------------+---------+\nsession_id is the unique ID for this table.\nEach row represents a reading session where someone read a portion of a book. session_rating is on a scale of 1-5.\n</pre>\n\n<p>Write a solution to find books that have <strong>polarized opinions</strong> - books that receive both very high ratings and very low ratings from different readers.</p>\n\n<ul>\n\t<li>A book has polarized opinions if it has <code>at least one rating &ge; 4</code> and <code>at least one rating &le; 2</code></li>\n\t<li>Only consider books that have <strong>at least </strong><code>5</code><strong> reading sessions</strong></li>\n\t<li>Calculate the <strong>rating spread</strong> as (<code>highest_rating - lowest_rating</code>)</li>\n\t<li>Calculate the <strong>polarization score</strong> as the number of extreme ratings (<code>ratings &le; 2 or &ge; 4</code>) divided by total sessions</li>\n\t<li><strong>Only include</strong> books where <code>polarization score &ge; 0.6</code> (at least <code>60%</code> extreme ratings)</li>\n</ul>\n\n<p>Return <em>the result table ordered by polarization score in <strong>descending</strong> order, then by title in <strong>descending</strong> order</em>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p>&nbsp;</p>\n<p><strong class=\"example\">Example:</strong></p>\n\n<div class=\"example-block\">\n<p><strong>Input:</strong></p>\n\n<p>books table:</p>\n\n<pre class=\"example-io\">\n+---------+------------------------+---------------+----------+-------+\n| book_id | title | author | genre | pages |\n+---------+------------------------+---------------+----------+-------+\n| 1 | The Great Gatsby | F. Scott | Fiction | 180 |\n| 2 | To Kill a Mockingbird | Harper Lee | Fiction | 281 |\n| 3 | 1984 | George Orwell | Dystopian| 328 |\n| 4 | Pride and Prejudice | Jane Austen | Romance | 432 |\n| 5 | The Catcher in the Rye | J.D. Salinger | Fiction | 277 |\n+---------+------------------------+---------------+----------+-------+\n</pre>\n\n<p>reading_sessions table:</p>\n\n<pre class=\"example-io\">\n+------------+---------+-------------+------------+----------------+\n| session_id | book_id | reader_name | pages_read | session_rating |\n+------------+---------+-------------+------------+----------------+\n| 1 | 1 | Alice | 50 | 5 |\n| 2 | 1 | Bob | 60 | 1 |\n| 3 | 1 | Carol | 40 | 4 |\n| 4 | 1 | David | 30 | 2 |\n| 5 | 1 | Emma | 45 | 5 |\n| 6 | 2 | Frank | 80 | 4 |\n| 7 | 2 | Grace | 70 | 4 |\n| 8 | 2 | Henry | 90 | 5 |\n| 9 | 2 | Ivy | 60 | 4 |\n| 10 | 2 | Jack | 75 | 4 |\n| 11 | 3 | Kate | 100 | 2 |\n| 12 | 3 | Liam | 120 | 1 |\n| 13 | 3 | Mia | 80 | 2 |\n| 14 | 3 | Noah | 90 | 1 |\n| 15 | 3 | Olivia | 110 | 4 |\n| 16 | 3 | Paul | 95 | 5 |\n| 17 | 4 | Quinn | 150 | 3 |\n| 18 | 4 | Ruby | 140 | 3 |\n| 19 | 5 | Sam | 80 | 1 |\n| 20 | 5 | Tara | 70 | 2 |\n+------------+---------+-------------+------------+----------------+\n</pre>\n\n<p><strong>Output:</strong></p>\n\n<pre class=\"example-io\">\n+---------+------------------+---------------+-----------+-------+---------------+--------------------+\n| book_id | title | author | genre | pages | rating_spread | polarization_score |\n+---------+------------------+---------------+-----------+-------+---------------+--------------------+\n| 1 | The Great Gatsby | F. Scott | Fiction | 180 | 4 | 1.00 |\n| 3 | 1984 | George Orwell | Dystopian | 328 | 4 | 1.00 |\n+---------+------------------+---------------+-----------+-------+---------------+--------------------+\n</pre>\n\n<p><strong>Explanation:</strong></p>\n\n<ul>\n\t<li><strong>The Great Gatsby (book_id = 1):</strong>\n\n\t<ul>\n\t\t<li>Has 5 reading sessions (meets minimum requirement)</li>\n\t\t<li>Ratings: 5, 1, 4, 2, 5</li>\n\t\t<li>Has ratings &ge; 4: 5, 4, 5 (3 sessions)</li>\n\t\t<li>Has ratings &le; 2: 1, 2 (2 sessions)</li>\n\t\t<li>Rating spread: 5 - 1 = 4</li>\n\t\t<li>Extreme ratings (&le;2 or &ge;4): All 5 sessions (5, 1, 4, 2, 5)</li>\n\t\t<li>Polarization score: 5/5 = 1.00 (&ge; 0.6, qualifies)</li>\n\t</ul>\n\t</li>\n\t<li><strong>1984 (book_id = 3):</strong>\n\t<ul>\n\t\t<li>Has 6 reading sessions (meets minimum requirement)</li>\n\t\t<li>Ratings: 2, 1, 2, 1, 4, 5</li>\n\t\t<li>Has ratings &ge; 4: 4, 5 (2 sessions)</li>\n\t\t<li>Has ratings &le; 2: 2, 1, 2, 1 (4 sessions)</li>\n\t\t<li>Rating spread: 5 - 1 = 4</li>\n\t\t<li>Extreme ratings (&le;2 or &ge;4): All 6 sessions (2, 1, 2, 1, 4, 5)</li>\n\t\t<li>Polarization score: 6/6 = 1.00 (&ge; 0.6, qualifies)</li>\n\t</ul>\n\t</li>\n\t<li><strong>Books not included:</strong>\n\t<ul>\n\t\t<li>To Kill a Mockingbird (book_id = 2): All ratings are 4-5, no low ratings (&le;2)</li>\n\t\t<li>Pride and Prejudice (book_id = 4): Only 2 sessions (&lt; 5 minimum)</li>\n\t\t<li>The Catcher in the Rye (book_id = 5): Only 2 sessions (&lt; 5 minimum)</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>The result table is ordered by polarization score in descending order, then by book title in descending order.</p>\n</div>\n",
"translatedTitle": "查找有两极分化观点的书籍",
"translatedContent": "<p>表:<code>books</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| book_id | int |\n| title | varchar |\n| author | varchar |\n| genre | varchar |\n| pages | int |\n+-------------+---------+\nbook_id 是这张表的唯一主键。\n每一行包含关于一本书的信息包括其类型和页数。\n</pre>\n\n<p>表:<code>reading_sessions</code></p>\n\n<pre>\n+----------------+---------+\n| Column Name | Type |\n+----------------+---------+\n| session_id | int |\n| book_id | int |\n| reader_name | varchar |\n| pages_read | int |\n| session_rating | int |\n+----------------+---------+\nsession_id 是这张表的唯一主键。\n每一行代表一次阅读事件有人阅读了书籍的一部分。session_rating 在 1-5 的范围内。\n</pre>\n\n<p>编写一个解决方案来找到具有 <strong>两极分化观点</strong> 的书 - 同时获得不同读者极高和极低评分的书籍。</p>\n\n<ul>\n\t<li>如果一本书有至少一个大于等于&nbsp;<code>4</code>&nbsp;的评分和至少一个小于等于&nbsp;<code>2</code>&nbsp;的评分则是有两极分化观点的书</li>\n\t<li>只考虑有至少 <code>5</code> 次阅读事件的书籍</li>\n\t<li>按&nbsp;<code>highest_rating - lowest_rating</code>&nbsp;计算评分差幅&nbsp;<strong>rating spread</strong></li>\n\t<li>按极端评分(评分小于等于 <code>2</code> 或大于等于 <code>4</code>)的数量除以总阅读事件计算 <strong>极化得分&nbsp;polarization score</strong></li>\n\t<li><strong>只包含</strong>&nbsp;极化得分大于等于&nbsp;<code>0.6</code>&nbsp;的书(至少&nbsp;<code>60%</code>&nbsp;极端评分)</li>\n</ul>\n\n<p>返回结果表按极化得分 <strong>降序</strong> 排序,然后按标题 <strong>降序</strong> 排序。</p>\n\n<p>返回格式如下所示。</p>\n\n<p>&nbsp;</p>\n\n<p><strong class=\"example\">示例:</strong></p>\n\n<div class=\"example-block\">\n<p><strong>输入:</strong></p>\n\n<p>books 表:</p>\n\n<pre class=\"example-io\">\n+---------+------------------------+---------------+----------+-------+\n| book_id | title | author | genre | pages |\n+---------+------------------------+---------------+----------+-------+\n| 1 | The Great Gatsby | F. Scott | Fiction | 180 |\n| 2 | To Kill a Mockingbird | Harper Lee | Fiction | 281 |\n| 3 | 1984 | George Orwell | Dystopian| 328 |\n| 4 | Pride and Prejudice | Jane Austen | Romance | 432 |\n| 5 | The Catcher in the Rye | J.D. Salinger | Fiction | 277 |\n+---------+------------------------+---------------+----------+-------+\n</pre>\n\n<p>reading_sessions 表:</p>\n\n<pre class=\"example-io\">\n+------------+---------+-------------+------------+----------------+\n| session_id | book_id | reader_name | pages_read | session_rating |\n+------------+---------+-------------+------------+----------------+\n| 1 | 1 | Alice | 50 | 5 |\n| 2 | 1 | Bob | 60 | 1 |\n| 3 | 1 | Carol | 40 | 4 |\n| 4 | 1 | David | 30 | 2 |\n| 5 | 1 | Emma | 45 | 5 |\n| 6 | 2 | Frank | 80 | 4 |\n| 7 | 2 | Grace | 70 | 4 |\n| 8 | 2 | Henry | 90 | 5 |\n| 9 | 2 | Ivy | 60 | 4 |\n| 10 | 2 | Jack | 75 | 4 |\n| 11 | 3 | Kate | 100 | 2 |\n| 12 | 3 | Liam | 120 | 1 |\n| 13 | 3 | Mia | 80 | 2 |\n| 14 | 3 | Noah | 90 | 1 |\n| 15 | 3 | Olivia | 110 | 4 |\n| 16 | 3 | Paul | 95 | 5 |\n| 17 | 4 | Quinn | 150 | 3 |\n| 18 | 4 | Ruby | 140 | 3 |\n| 19 | 5 | Sam | 80 | 1 |\n| 20 | 5 | Tara | 70 | 2 |\n+------------+---------+-------------+------------+----------------+\n</pre>\n\n<p><strong>输出:</strong></p>\n\n<pre class=\"example-io\">\n+---------+------------------+---------------+-----------+-------+---------------+--------------------+\n| book_id | title | author | genre | pages | rating_spread | polarization_score |\n+---------+------------------+---------------+-----------+-------+---------------+--------------------+\n| 1 | The Great Gatsby | F. Scott | Fiction | 180 | 4 | 1.00 |\n| 3 | 1984 | George Orwell | Dystopian | 328 | 4 | 1.00 |\n+---------+------------------+---------------+-----------+-------+---------------+--------------------+\n</pre>\n\n<p><strong>解释:</strong></p>\n\n<ul>\n\t<li><strong>了不起的盖茨比book_id = 1</strong>\n\n\t<ul>\n\t\t<li>有 5 次阅读事件(满足最少要求)</li>\n\t\t<li>评分5, 1, 4, 2, 5</li>\n\t\t<li>大于等于 4 的评分5453 次事件)</li>\n\t\t<li>小于等于 2 的评分122 次事件)</li>\n\t\t<li>评分差5 - 1 = 4</li>\n\t\t<li>极端评分≤2 或&nbsp;≥4所有 5 次事件51425</li>\n\t\t<li>极化得分5/5 = 1.00(≥&nbsp;0.6,符合)</li>\n\t</ul>\n\t</li>\n\t<li><strong>1984 (book_id = 3):</strong>\n\t<ul>\n\t\t<li>有 6&nbsp;次阅读事件(满足最少要求)</li>\n\t\t<li>评分212145</li>\n\t\t<li>大于等于 4 的评分452 次事件)</li>\n\t\t<li>小于等于 2 的评分21214&nbsp;次事件)</li>\n\t\t<li>评分差5 - 1 = 4</li>\n\t\t<li>极端评分≤2 或&nbsp;≥4所有 6&nbsp;次事件212145</li>\n\t\t<li>极化得分6/6 = 1.00 (≥ 0.6,符合)</li>\n\t</ul>\n\t</li>\n\t<li><strong>未包含的书:</strong>\n\t<ul>\n\t\t<li>杀死一只知更鸟book_id = 2所有评分为 4-5没有低分≤2</li>\n\t\t<li>傲慢与偏见book_id = 4只有&nbsp;2 次事件(&lt; 最少 5 次)</li>\n\t\t<li>麦田里的守望者book_id = 5只有&nbsp;2 次事件(&lt; 最少 5 次)</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>结果表按极化得分降序排序,然后按标题降序排序。</p>\n</div>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 1,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
"contributors": [],
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python3\": false, \"python\": false, \"javascript\": false, \"typescript\": false, \"csharp\": false, \"c\": false, \"golang\": false, \"kotlin\": false, \"swift\": false, \"rust\": false, \"ruby\": false, \"php\": false, \"dart\": false, \"scala\": false, \"elixir\": false, \"erlang\": false, \"racket\": false, \"cangjie\": false, \"bash\": false, \"html\": false, \"pythonml\": false, \"react\": false, \"vanillajs\": false, \"mysql\": false, \"mssql\": false, \"postgresql\": false, \"oraclesql\": false, \"pythondata\": false}",
"topicTags": [],
"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": "PostgreSQL",
"langSlug": "postgresql",
"code": "-- Write your PostgreSQL query statement below",
"__typename": "CodeSnippetNode"
},
{
"lang": "Oracle",
"langSlug": "oraclesql",
"code": "/* Write your PL/SQL query statement below */",
"__typename": "CodeSnippetNode"
},
{
"lang": "Pandas",
"langSlug": "pythondata",
"code": "import pandas as pd\n\ndef find_polarized_books(books: pd.DataFrame, reading_sessions: pd.DataFrame) -> pd.DataFrame:\n ",
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"756\", \"totalSubmission\": \"1.9K\", \"totalAcceptedRaw\": 756, \"totalSubmissionRaw\": 1902, \"acRate\": \"39.7%\"}",
"hints": [],
"solution": null,
"status": null,
"sampleTestCase": "{\"headers\":{\"books\":[\"book_id\",\"title\",\"author\",\"genre\",\"pages\"],\"reading_sessions\":[\"session_id\",\"book_id\",\"reader_name\",\"pages_read\",\"session_rating\"]},\"rows\":{\"books\":[[1,\"The Great Gatsby\",\"F. Scott\",\"Fiction\",180],[2,\"To Kill a Mockingbird\",\"Harper Lee\",\"Fiction\",281],[3,\"1984\",\"George Orwell\",\"Dystopian\",328],[4,\"Pride and Prejudice\",\"Jane Austen\",\"Romance\",432],[5,\"The Catcher in the Rye\",\"J.D. Salinger\",\"Fiction\",277]],\"reading_sessions\":[[1,1,\"Alice\",50,5],[2,1,\"Bob\",60,1],[3,1,\"Carol\",40,4],[4,1,\"David\",30,2],[5,1,\"Emma\",45,5],[6,2,\"Frank\",80,4],[7,2,\"Grace\",70,4],[8,2,\"Henry\",90,5],[9,2,\"Ivy\",60,4],[10,2,\"Jack\",75,4],[11,3,\"Kate\",100,2],[12,3,\"Liam\",120,1],[13,3,\"Mia\",80,2],[14,3,\"Noah\",90,1],[15,3,\"Olivia\",110,4],[16,3,\"Paul\",95,5],[17,4,\"Quinn\",150,3],[18,4,\"Ruby\",140,3],[19,5,\"Sam\",80,1],[20,5,\"Tara\",70,2]]}}",
"metaData": "{\"mysql\":[\"CREATE TABLE books (\\n book_id INT,\\n title VARCHAR(255),\\n author VARCHAR(255),\\n genre VARCHAR(100),\\n pages INT\\n)\",\"CREATE TABLE reading_sessions (\\n session_id INT,\\n book_id INT,\\n reader_name VARCHAR(255),\\n pages_read INT,\\n session_rating INT\\n)\"],\"mssql\":[\"CREATE TABLE books (\\n book_id INT,\\n title VARCHAR(255),\\n author VARCHAR(255),\\n genre VARCHAR(100),\\n pages INT\\n)\",\"CREATE TABLE reading_sessions (\\n session_id INT,\\n book_id INT,\\n reader_name VARCHAR(255),\\n pages_read INT,\\n session_rating INT\\n)\"],\"oraclesql\":[\"CREATE TABLE books (\\n book_id NUMBER,\\n title VARCHAR2(255),\\n author VARCHAR2(255),\\n genre VARCHAR2(100),\\n pages NUMBER\\n)\",\"CREATE TABLE reading_sessions (\\n session_id NUMBER,\\n book_id NUMBER,\\n reader_name VARCHAR2(255),\\n pages_read NUMBER,\\n session_rating NUMBER\\n)\"],\"database\":true,\"name\":\"find_polarized_books\",\"postgresql\":[\"CREATE TABLE books (\\n book_id SERIAL PRIMARY KEY,\\n title VARCHAR(255),\\n author VARCHAR(255),\\n genre VARCHAR(100),\\n pages INTEGER\\n);\\n\",\"CREATE TABLE reading_sessions (\\n session_id SERIAL PRIMARY KEY,\\n book_id INTEGER,\\n reader_name VARCHAR(255),\\n pages_read INTEGER,\\n session_rating INTEGER\\n);\\n\"],\"pythondata\":[\"books = pd.DataFrame({\\n \\\"book_id\\\": pd.Series(dtype=\\\"int64\\\"), # SERIAL -> int64\\n \\\"title\\\": pd.Series(dtype=\\\"string\\\"), # VARCHAR -> string dtype\\n \\\"author\\\": pd.Series(dtype=\\\"string\\\"), # VARCHAR -> string dtype\\n \\\"genre\\\": pd.Series(dtype=\\\"string\\\"), # VARCHAR -> string dtype\\n \\\"pages\\\": pd.Series(dtype=\\\"int64\\\") # INTEGER -> int64\\n})\",\"reading_sessions = pd.DataFrame({\\n \\\"session_id\\\": pd.Series(dtype=\\\"int64\\\"), # NUMBER -> int64\\n \\\"book_id\\\": pd.Series(dtype=\\\"int64\\\"), # NUMBER -> int64\\n \\\"reader_name\\\": pd.Series(dtype=\\\"string\\\"), # VARCHAR2 -> string dtype\\n \\\"pages_read\\\": pd.Series(dtype=\\\"int64\\\"), # NUMBER -> int64\\n \\\"session_rating\\\": pd.Series(dtype=\\\"int64\\\") # NUMBER -> int64\\n})\"],\"database_schema\":{\"books\":{\"book_id\":\"INT\",\"title\":\"VARCHAR(255)\",\"author\":\"VARCHAR(255)\",\"genre\":\"VARCHAR(100)\",\"pages\":\"INT\"},\"reading_sessions\":{\"session_id\":\"INT\",\"book_id\":\"INT\",\"reader_name\":\"VARCHAR(255)\",\"pages_read\":\"INT\",\"session_rating\":\"INT\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"CREATE TABLE books (\n book_id INT,\n title VARCHAR(255),\n author VARCHAR(255),\n genre VARCHAR(100),\n pages INT\n)",
"CREATE TABLE reading_sessions (\n session_id INT,\n book_id INT,\n reader_name VARCHAR(255),\n pages_read INT,\n session_rating INT\n)",
"Truncate table books",
"insert into books (book_id, title, author, genre, pages) values ('1', 'The Great Gatsby', 'F. Scott', 'Fiction', '180')",
"insert into books (book_id, title, author, genre, pages) values ('2', 'To Kill a Mockingbird', 'Harper Lee', 'Fiction', '281')",
"insert into books (book_id, title, author, genre, pages) values ('3', '1984', 'George Orwell', 'Dystopian', '328')",
"insert into books (book_id, title, author, genre, pages) values ('4', 'Pride and Prejudice', 'Jane Austen', 'Romance', '432')",
"insert into books (book_id, title, author, genre, pages) values ('5', 'The Catcher in the Rye', 'J.D. Salinger', 'Fiction', '277')",
"Truncate table reading_sessions",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('1', '1', 'Alice', '50', '5')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('2', '1', 'Bob', '60', '1')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('3', '1', 'Carol', '40', '4')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('4', '1', 'David', '30', '2')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('5', '1', 'Emma', '45', '5')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('6', '2', 'Frank', '80', '4')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('7', '2', 'Grace', '70', '4')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('8', '2', 'Henry', '90', '5')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('9', '2', 'Ivy', '60', '4')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('10', '2', 'Jack', '75', '4')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('11', '3', 'Kate', '100', '2')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('12', '3', 'Liam', '120', '1')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('13', '3', 'Mia', '80', '2')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('14', '3', 'Noah', '90', '1')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('15', '3', 'Olivia', '110', '4')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('16', '3', 'Paul', '95', '5')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('17', '4', 'Quinn', '150', '3')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('18', '4', 'Ruby', '140', '3')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('19', '5', 'Sam', '80', '1')",
"insert into reading_sessions (session_id, book_id, reader_name, pages_read, session_rating) values ('20', '5', 'Tara', '70', '2')"
],
"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>\"],\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "{\"headers\":{\"books\":[\"book_id\",\"title\",\"author\",\"genre\",\"pages\"],\"reading_sessions\":[\"session_id\",\"book_id\",\"reader_name\",\"pages_read\",\"session_rating\"]},\"rows\":{\"books\":[[1,\"The Great Gatsby\",\"F. Scott\",\"Fiction\",180],[2,\"To Kill a Mockingbird\",\"Harper Lee\",\"Fiction\",281],[3,\"1984\",\"George Orwell\",\"Dystopian\",328],[4,\"Pride and Prejudice\",\"Jane Austen\",\"Romance\",432],[5,\"The Catcher in the Rye\",\"J.D. Salinger\",\"Fiction\",277]],\"reading_sessions\":[[1,1,\"Alice\",50,5],[2,1,\"Bob\",60,1],[3,1,\"Carol\",40,4],[4,1,\"David\",30,2],[5,1,\"Emma\",45,5],[6,2,\"Frank\",80,4],[7,2,\"Grace\",70,4],[8,2,\"Henry\",90,5],[9,2,\"Ivy\",60,4],[10,2,\"Jack\",75,4],[11,3,\"Kate\",100,2],[12,3,\"Liam\",120,1],[13,3,\"Mia\",80,2],[14,3,\"Noah\",90,1],[15,3,\"Olivia\",110,4],[16,3,\"Paul\",95,5],[17,4,\"Quinn\",150,3],[18,4,\"Ruby\",140,3],[19,5,\"Sam\",80,1],[20,5,\"Tara\",70,2]]}}",
"__typename": "QuestionNode"
}
}
}