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/problem (Chinese)/丢失信息的雇员 [employees-with-missing-information].html
2022-03-29 12:43:11 +08:00

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 is 这个表的主键。
每一行表示雇员的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>