mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 00:11:41 +08:00
批量更新数据
This commit is contained in:
@@ -12,12 +12,12 @@
|
||||
"translatedContent": "<p>表:<code>Employee</code> </p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| empId | int |\n| name | varchar |\n| supervisor | int |\n| salary | int |\n+-------------+---------+\nempId 是该表中具有唯一值的列。\n该表的每一行都表示员工的姓名和 id,以及他们的工资和经理的 id。\n</pre>\n\n<p> </p>\n\n<p>表:<code>Bonus</code></p>\n\n<pre>\n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| empId | int |\n| bonus | int |\n+-------------+------+\nempId 是该表具有唯一值的列。\nempId 是 Employee 表中 empId 的外键(reference 列)。\n该表的每一行都包含一个员工的 id 和他们各自的奖金。\n</pre>\n\n<p> </p>\n\n<p>编写解决方案,报告每个奖金 <strong>少于</strong> <code>1000</code> 的员工的姓名和奖金数额。</p>\n\n<p>以 <strong>任意顺序</strong> 返回结果表。</p>\n\n<p>结果格式如下所示。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>\nEmployee table:\n+-------+--------+------------+--------+\n| empId | name | supervisor | salary |\n+-------+--------+------------+--------+\n| 3 | Brad | null | 4000 |\n| 1 | John | 3 | 1000 |\n| 2 | Dan | 3 | 2000 |\n| 4 | Thomas | 3 | 4000 |\n+-------+--------+------------+--------+\nBonus table:\n+-------+-------+\n| empId | bonus |\n+-------+-------+\n| 2 | 500 |\n| 4 | 2000 |\n+-------+-------+\n<b>输出:</b>\n+------+-------+\n| name | bonus |\n+------+-------+\n| Brad | null |\n| John | null |\n| Dan | 500 |\n+------+-------+</pre>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 81,
|
||||
"likes": 111,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Combine Two Tables\", \"titleSlug\": \"combine-two-tables\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u7ec4\\u5408\\u4e24\\u4e2a\\u8868\", \"isPaidOnly\": false}]",
|
||||
"contributors": [],
|
||||
"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}",
|
||||
"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, \"cangjie\": false}",
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
@@ -59,7 +59,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"60.6K\", \"totalSubmission\": \"87.3K\", \"totalAcceptedRaw\": 60601, \"totalSubmissionRaw\": 87326, \"acRate\": \"69.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"116.4K\", \"totalSubmission\": \"163.2K\", \"totalAcceptedRaw\": 116364, \"totalSubmissionRaw\": 163221, \"acRate\": \"71.3%\"}",
|
||||
"hints": [
|
||||
"If the EmpId in table Employee has no match in table Bonus, we consider that the corresponding bonus is null and null is smaller than 1000.",
|
||||
"Inner join is the default join, we can solve the mismatching problem by using outer join."
|
||||
@@ -74,7 +74,7 @@
|
||||
"Create table If Not Exists Employee (empId int, name varchar(255), supervisor int, salary int)",
|
||||
"Create table If Not Exists Bonus (empId int, bonus int)",
|
||||
"Truncate table Employee",
|
||||
"insert into Employee (empId, name, supervisor, salary) values ('3', 'Brad', 'None', '4000')",
|
||||
"insert into Employee (empId, name, supervisor, salary) values ('3', 'Brad', NULL, '4000')",
|
||||
"insert into Employee (empId, name, supervisor, salary) values ('1', 'John', '3', '1000')",
|
||||
"insert into Employee (empId, name, supervisor, salary) values ('2', 'Dan', '3', '2000')",
|
||||
"insert into Employee (empId, name, supervisor, salary) values ('4', 'Thomas', '3', '4000')",
|
||||
@@ -83,7 +83,7 @@
|
||||
"insert into Bonus (empId, bonus) values ('4', '2000')"
|
||||
],
|
||||
"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.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/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.2.2 and NumPy 1.26.4<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
|
Reference in New Issue
Block a user