1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode/originData/delete-duplicate-emails.json

94 lines
6.4 KiB
JSON
Raw Normal View History

2022-03-27 18:35:17 +08:00
{
"data": {
"question": {
"questionId": "196",
"questionFrontendId": "196",
"boundTopicId": null,
"title": "Delete Duplicate Emails",
"titleSlug": "delete-duplicate-emails",
2023-12-09 18:42:21 +08:00
"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",
2022-03-27 18:35:17 +08:00
"translatedTitle": null,
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Easy",
2023-12-09 18:42:21 +08:00
"likes": 1466,
"dislikes": 294,
2022-03-27 18:35:17 +08:00
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\": {\"Person\": [\"id\", \"email\"]}, \"rows\": {\"Person\": [[1, \"john@example.com\"], [2, \"bob@example.com\"], [3, \"john@example.com\"]]}}",
"categoryTitle": "Database",
"contributors": [],
"topicTags": [
{
"name": "Database",
"slug": "database",
"translatedName": null,
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": [
{
"lang": "MySQL",
"langSlug": "mysql",
2023-12-09 18:42:21 +08:00
"code": "# Write your MySQL query statement below\n",
2022-03-27 18:35:17 +08:00
"__typename": "CodeSnippetNode"
},
{
"lang": "MS SQL Server",
"langSlug": "mssql",
2023-12-09 18:42:21 +08:00
"code": "/* Write your T-SQL query statement below */\n",
2022-03-27 18:35:17 +08:00
"__typename": "CodeSnippetNode"
},
{
"lang": "Oracle",
"langSlug": "oraclesql",
2023-12-09 18:42:21 +08:00
"code": "/* Write your PL/SQL query statement below */\n",
"__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\n",
2022-03-27 18:35:17 +08:00
"__typename": "CodeSnippetNode"
}
],
2023-12-09 19:57:46 +08:00
"stats": "{\"totalAccepted\": \"463.5K\", \"totalSubmission\": \"758.6K\", \"totalAcceptedRaw\": 463456, \"totalSubmissionRaw\": 758650, \"acRate\": \"61.1%\"}",
2022-03-27 18:35:17 +08:00
"hints": [],
"solution": {
"id": "210",
2023-12-09 18:42:21 +08:00
"canSeeDetail": false,
"paidOnly": true,
2022-03-27 18:35:17 +08:00
"hasVideoSolution": false,
"paidOnlyVideo": true,
"__typename": "ArticleNode"
},
"status": null,
"sampleTestCase": "{\"headers\": {\"Person\": [\"id\", \"email\"]}, \"rows\": {\"Person\": [[1, \"john@example.com\"], [2, \"bob@example.com\"], [3, \"john@example.com\"]]}}",
2023-12-09 18:42:21 +08:00
"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)\"}}}",
2022-03-27 18:35:17 +08:00
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"Create table If Not Exists Person (Id int, Email varchar(255))",
"Truncate table Person",
"insert into Person (id, email) values ('1', 'john@example.com')",
"insert into Person (id, email) values ('2', 'bob@example.com')",
"insert into Person (id, email) values ('3', 'john@example.com')"
],
"enableRunCode": true,
"enableTestMode": false,
"enableDebugger": false,
2023-12-09 18:42:21 +08:00
"envInfo": "{\"mysql\": [\"MySQL\", \"<p><code>MySQL 8.0</code>.</p>\"], \"mssql\": [\"MS SQL Server\", \"<p><code>mssql server 2019</code>.</p>\"], \"oraclesql\": [\"Oracle\", \"<p><code>Oracle Sql 11.2</code>.</p>\"], \"pythondata\": [\"Pandas\", \"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0</p>\"], \"postgresql\": [\"PostgreSQL\", \"<p>PostgreSQL 16</p>\"]}",
2022-03-27 18:35:17 +08:00
"libraryUrl": null,
"adminUrl": null,
"challengeQuestion": null,
"__typename": "QuestionNode"
}
}
}