1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/originData/delete-duplicate-emails.json
2022-03-29 16:56:27 +08:00

82 lines
6.9 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": "196",
"questionFrontendId": "196",
"categoryTitle": "Database",
"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",
"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> 所有重复的电子邮件只保留一个id最小的唯一电子邮件。</p>\n\n<p>以 <strong>任意顺序</strong> 返回结果表。</p>\n\n<p>查询结果格式如下所示。</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",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 464,
"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": "# Please write a DELETE statement and DO NOT write a SELECT statement.\n# 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 */",
"__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 */",
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"121.4K\", \"totalSubmission\": \"182.9K\", \"totalAcceptedRaw\": 121413, \"totalSubmissionRaw\": 182921, \"acRate\": \"66.4%\"}",
"hints": [],
"solution": {
"id": "98",
"canSeeDetail": true,
"__typename": "ArticleNode"
},
"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}",
"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,
"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\": {\"Person\": [\"id\", \"email\"]}, \"rows\": {\"Person\": [[1, \"john@example.com\"], [2, \"bob@example.com\"], [3, \"john@example.com\"]]}}",
"__typename": "QuestionNode"
}
}
}