Skip to content

Commit a81a6ec

Browse files
Create README - LeetHub
1 parent a407e65 commit a81a6ec

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

0577-employee-bonus/README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<h2><a href="https://leetcode.com/problems/employee-bonus/">577. Employee Bonus</a></h2><h3>Easy</h3><hr><div class="sql-schema-wrapper__3VBi"><a class="sql-schema-link__3cEg">SQL Schema<svg viewBox="0 0 24 24" width="1em" height="1em" class="icon__1Md2"><path fill-rule="evenodd" d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></svg></a></div><div><p>Table: <code>Employee</code></p>
2+
3+
<pre>+-------------+---------+
4+
| Column Name | Type |
5+
+-------------+---------+
6+
| empId | int |
7+
| name | varchar |
8+
| supervisor | int |
9+
| salary | int |
10+
+-------------+---------+
11+
empId is the column with unique values for this table.
12+
Each row of this table indicates the name and the ID of an employee in addition to their salary and the id of their manager.
13+
</pre>
14+
15+
<p>&nbsp;</p>
16+
17+
<p>Table: <code>Bonus</code></p>
18+
19+
<pre>+-------------+------+
20+
| Column Name | Type |
21+
+-------------+------+
22+
| empId | int |
23+
| bonus | int |
24+
+-------------+------+
25+
empId is the column of unique values for this table.
26+
empId is a foreign key (reference column) to empId from the Employee table.
27+
Each row of this table contains the id of an employee and their respective bonus.
28+
</pre>
29+
30+
<p>&nbsp;</p>
31+
32+
<p>Write a solution to report the name and bonus amount of each employee with a bonus <strong>less than</strong> <code>1000</code>.</p>
33+
34+
<p>Return the result table in <strong>any order</strong>.</p>
35+
36+
<p>The&nbsp;result format is in the following example.</p>
37+
38+
<p>&nbsp;</p>
39+
<p><strong class="example">Example 1:</strong></p>
40+
41+
<pre><strong>Input:</strong>
42+
Employee table:
43+
+-------+--------+------------+--------+
44+
| empId | name | supervisor | salary |
45+
+-------+--------+------------+--------+
46+
| 3 | Brad | null | 4000 |
47+
| 1 | John | 3 | 1000 |
48+
| 2 | Dan | 3 | 2000 |
49+
| 4 | Thomas | 3 | 4000 |
50+
+-------+--------+------------+--------+
51+
Bonus table:
52+
+-------+-------+
53+
| empId | bonus |
54+
+-------+-------+
55+
| 2 | 500 |
56+
| 4 | 2000 |
57+
+-------+-------+
58+
<strong>Output:</strong>
59+
+------+-------+
60+
| name | bonus |
61+
+------+-------+
62+
| Brad | null |
63+
| John | null |
64+
| Dan | 500 |
65+
+------+-------+
66+
</pre>
67+
</div>

0 commit comments

Comments
 (0)