1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 23:41:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -7,17 +7,17 @@
"boundTopicId": 1235,
"title": "Delete Duplicate Emails",
"titleSlug": "delete-duplicate-emails",
"content": "<p>Table: <code>Person</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| email | varchar |\n+-------------+---------+\nid is the primary key column for this table.\nEach row of this table contains an email. The emails will not contain uppercase letters.\n</pre>\n\n<p>&nbsp;</p>\n\n<p>Write an SQL query to <strong>delete</strong> all the duplicate emails, keeping only one unique email with the smallest <code>id</code>. Note that you are supposed to write a <code>DELETE</code> statement and not a <code>SELECT</code> one.</p>\n\n<p>Return the result table in <strong>any order</strong>.</p>\n\n<p>The query result format is in the following example.</p>\n\n<p>&nbsp;</p>\n<p><strong>Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nPerson table:\n+----+------------------+\n| id | email |\n+----+------------------+\n| 1 | john@example.com |\n| 2 | bob@example.com |\n| 3 | john@example.com |\n+----+------------------+\n<strong>Output:</strong> \n+----+------------------+\n| id | email |\n+----+------------------+\n| 1 | john@example.com |\n| 2 | bob@example.com |\n+----+------------------+\n<strong>Explanation:</strong> john@example.com is repeated two times. We keep the row with the smallest Id = 1.\n</pre>\n",
"content": "<p>Table: <code>Person</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| email | varchar |\n+-------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table contains an email. The emails will not contain uppercase letters.\n</pre>\n\n<p>&nbsp;</p>\n\n<p>Write a solution to<strong> delete</strong> all duplicate emails, keeping only one unique email with the smallest <code>id</code>.</p>\n\n<p>For SQL users, please note that you are supposed to write a <code>DELETE</code> statement and not a <code>SELECT</code> one.</p>\n\n<p>For Pandas users, please note that you are supposed to modify <code>Person</code> in place.</p>\n\n<p>After running your script, the answer shown is the <code>Person</code> table. The driver will first compile and run your piece of code and then show the <code>Person</code> table. The final order of the <code>Person</code> table <strong>does not matter</strong>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p>&nbsp;</p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nPerson table:\n+----+------------------+\n| id | email |\n+----+------------------+\n| 1 | john@example.com |\n| 2 | bob@example.com |\n| 3 | john@example.com |\n+----+------------------+\n<strong>Output:</strong> \n+----+------------------+\n| id | email |\n+----+------------------+\n| 1 | john@example.com |\n| 2 | bob@example.com |\n+----+------------------+\n<strong>Explanation:</strong> john@example.com is repeated two times. We keep the row with the smallest Id = 1.\n</pre>\n",
"translatedTitle": "删除重复的电子邮箱",
"translatedContent": "<p>表:&nbsp;<code>Person</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| email | varchar |\n+-------------+---------+\nid是该表的主键列。\n该表的每一行包含一封电子邮件。电子邮件将不包含大写字母。\n</pre>\n\n<p>&nbsp;</p>\n\n<p>编写一个 SQL <strong>删除语句</strong>来 <strong>删除</strong> 所有重复的电子邮件只保留一个id最小的唯一电子邮件。</p>\n\n<p>以 <strong>任意顺序</strong> 返回结果表。 <strong>注意</strong> 仅需要写删除语句,将自动对剩余结果进行查询)</p>\n\n<p>查询结果格式如下所示。</p>\n\n<p>&nbsp;</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> \nPerson 表:\n+----+------------------+\n| id | email |\n+----+------------------+\n| 1 | john@example.com |\n| 2 | bob@example.com |\n| 3 | john@example.com |\n+----+------------------+\n<strong>输出:</strong> \n+----+------------------+\n| id | email |\n+----+------------------+\n| 1 | john@example.com |\n| 2 | bob@example.com |\n+----+------------------+\n<strong>解释:</strong> john@example.com重复两次。我们保留最小的Id = 1。</pre>\n",
"translatedContent": "<p>表:&nbsp;<code>Person</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| email | varchar |\n+-------------+---------+\nid 是该表的主键列(具有唯一值的列)。\n该表的每一行包含一封电子邮件。电子邮件将不包含大写字母。\n</pre>\n\n<p>&nbsp;</p>\n\n<p>编写解决方案<strong> 删除</strong> 所有重复的电子邮件,只保留一个具有最小 <code>id</code> 的唯一电子邮件。</p>\n\n<p>(对于 SQL 用户,请注意你应该编写一个 <code>DELETE</code> 语句而不是 <code>SELECT</code> 语句。)</p>\n\n<p>(对于 Pandas 用户,请注意你应该直接修改 <code>Person</code> 表。)</p>\n\n<p>运行脚本后,显示的答案是 <code>Person</code> 表。驱动程序将首先编译并运行您的代码片段,然后再显示 <code>Person</code> 表。<code>Person</code> 表的最终顺序 <strong>无关紧要</strong></p>\n\n<p>返回结果格式如下示例所示。</p>\n\n<p>&nbsp;</p>\n\n<p><strong class=\"example\">示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> \nPerson 表:\n+----+------------------+\n| id | email |\n+----+------------------+\n| 1 | john@example.com |\n| 2 | bob@example.com |\n| 3 | john@example.com |\n+----+------------------+\n<strong>输出:</strong> \n+----+------------------+\n| id | email |\n+----+------------------+\n| 1 | john@example.com |\n| 2 | bob@example.com |\n+----+------------------+\n<strong>解释:</strong> john@example.com重复两次。我们保留最小的Id = 1。</pre>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 496,
"likes": 789,
"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}",
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false}",
"topicTags": [
{
"name": "Database",
@@ -31,23 +31,35 @@
{
"lang": "MySQL",
"langSlug": "mysql",
"code": "# Please write a DELETE statement and DO NOT write a SELECT statement.\n# Write your MySQL query statement below",
"code": "# Write your MySQL query statement below",
"__typename": "CodeSnippetNode"
},
{
"lang": "MS SQL Server",
"langSlug": "mssql",
"code": "/* \n Please write a DELETE statement and DO NOT write a SELECT statement.\n Write your T-SQL query statement below\n */",
"code": "/* Write your T-SQL query statement below */",
"__typename": "CodeSnippetNode"
},
{
"lang": "Oracle",
"langSlug": "oraclesql",
"code": "/*\n Please write a DELETE statement and DO NOT write a SELECT statement.\n Write your PL/SQL query statement below\n */",
"code": "/* Write your PL/SQL query statement below */",
"__typename": "CodeSnippetNode"
},
{
"lang": "Pandas",
"langSlug": "pythondata",
"code": "import pandas as pd\n\ndef delete_duplicate_emails(person: pd.DataFrame) -> None:\n ",
"__typename": "CodeSnippetNode"
},
{
"lang": "PostgreSQL",
"langSlug": "postgresql",
"code": "-- Write your PostgreSQL query statement below",
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"129.9K\", \"totalSubmission\": \"194.2K\", \"totalAcceptedRaw\": 129928, \"totalSubmissionRaw\": 194216, \"acRate\": \"66.9%\"}",
"stats": "{\"totalAccepted\": \"236.2K\", \"totalSubmission\": \"348.9K\", \"totalAcceptedRaw\": 236235, \"totalSubmissionRaw\": 348910, \"acRate\": \"67.7%\"}",
"hints": [],
"solution": {
"id": "98",
@@ -56,7 +68,7 @@
},
"status": null,
"sampleTestCase": "{\"headers\": {\"Person\": [\"id\", \"email\"]}, \"rows\": {\"Person\": [[1, \"john@example.com\"], [2, \"bob@example.com\"], [3, \"john@example.com\"]]}}",
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Person (Id int, Email varchar(255))\"\n ],\n \"mssql\": [\n \"Create table Person (Id int, Email varchar(255))\"\n ],\n \"oraclesql\": [\n \"Create table Person (Id int, Email varchar(255))\"\n ],\n \"database\": true,\n \"manual\": true\n}",
"metaData": "{\"mysql\":[\"Create table If Not Exists Person (Id int, Email varchar(255))\"],\"mssql\":[\"Create table Person (Id int, Email varchar(255))\"],\"oraclesql\":[\"Create table Person (Id int, Email varchar(255))\"],\"database\":true,\"manual\":true,\"name\":\"delete_duplicate_emails\",\"pythondata\":[\"Person = pd.DataFrame([], columns=['id', 'email']).astype({'id':'int64', 'email':'object'})\"],\"postgresql\":[\"Create table If Not Exists Person (Id int, Email varchar(255))\\n\"],\"database_schema\":{\"Person\":{\"Id\":\"INT\",\"Email\":\"VARCHAR(255)\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
@@ -67,7 +79,7 @@
"insert into Person (id, email) values ('3', 'john@example.com')"
],
"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>\"]}",
"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.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,