1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 14:12:17 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>部门表&nbsp;<code>Department</code></p>\n\n<pre>\n+---------------+---------+\n| Column Name | Type |\n+---------------+---------+\n| id | int |\n| revenue | int |\n| month | varchar |\n+---------------+---------+\n(id, month) 是表的联合主键。\n这个表格有关于每个部门每月收入的信息。\n月份month可以取下列值 [&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;,&quot;Sep&quot;,&quot;Oct&quot;,&quot;Nov&quot;,&quot;Dec&quot;]。\n</pre>\n\n<p>&nbsp;</p>\n\n<p>编写一个 SQL 查询来重新格式化表,使得新的表中有一个部门 id 列和一些对应&nbsp;<strong>每个月 </strong>的收入revenue列。</p>\n\n<p>查询结果格式如下面的示例所示:</p>\n\n<pre>\nDepartment 表:\n+------+---------+-------+\n| id | revenue | month |\n+------+---------+-------+\n| 1 | 8000 | Jan |\n| 2 | 9000 | Jan |\n| 3 | 10000 | Feb |\n| 1 | 7000 | Feb |\n| 1 | 6000 | Mar |\n+------+---------+-------+\n\n查询得到的结果表\n+------+-------------+-------------+-------------+-----+-------------+\n| id | Jan_Revenue | Feb_Revenue | Mar_Revenue | ... | Dec_Revenue |\n+------+-------------+-------------+-------------+-----+-------------+\n| 1 | 8000 | 7000 | 6000 | ... | null |\n| 2 | 9000 | null | null | ... | null |\n| 3 | null | 10000 | null | ... | null |\n+------+-------------+-------------+-------------+-----+-------------+\n\n注意结果表有 13 列 (1个部门 id 列 + 12个月份的收入列)。\n</pre>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 161,
"likes": 165,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -47,7 +47,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"36.6K\", \"totalSubmission\": \"57.2K\", \"totalAcceptedRaw\": 36609, \"totalSubmissionRaw\": 57245, \"acRate\": \"64.0%\"}",
"stats": "{\"totalAccepted\": \"37.6K\", \"totalSubmission\": \"58.7K\", \"totalAcceptedRaw\": 37571, \"totalSubmissionRaw\": 58655, \"acRate\": \"64.1%\"}",
"hints": [],
"solution": null,
"status": null,