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-cn/problem (Chinese)/丢失信息的雇员 [employees-with-missing-information].html

73 lines
1.8 KiB
HTML
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.

<p>表: <code>Employees</code></p>
<pre>
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| employee_id | int |
| name | varchar |
+-------------+---------+
employee_id 是该表中具有唯一值的列。
每一行表示雇员的 id 和他的姓名。
</pre>
<p>表: <code>Salaries</code></p>
<pre>
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| employee_id | int |
| salary | int |
+-------------+---------+
employee_id 是该表中具有唯一值的列。
每一行表示雇员的 id 和他的薪水。
</pre>
<p>&nbsp;</p>
<p>编写解决方案,找到所有 <strong>丢失信息</strong> 的雇员 id。当满足下面一个条件时就被认为是雇员的信息丢失</p>
<ul>
<li>雇员的 <strong>姓名</strong> 丢失了,或者</li>
<li>雇员的 <strong>薪水信息</strong> 丢失了</li>
</ul>
<p>返回这些雇员的 id &nbsp;<code>employee_id</code>&nbsp;&nbsp;<strong>从小到大排序&nbsp;</strong></p>
<p>查询结果格式如下面的例子所示。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>
Employees table:
+-------------+----------+
| employee_id | name |
+-------------+----------+
| 2 | Crew |
| 4 | Haven |
| 5 | Kristian |
+-------------+----------+
Salaries table:
+-------------+--------+
| employee_id | salary |
+-------------+--------+
| 5 | 76071 |
| 1 | 22517 |
| 4 | 63539 |
+-------------+--------+
<strong>输出:</strong>
+-------------+
| employee_id |
+-------------+
| 1 |
| 2 |
+-------------+
<strong>解释:</strong>
雇员 1245 都在这个公司工作。
1 号雇员的姓名丢失了。
2 号雇员的薪水信息丢失了。</pre>