File tree Expand file tree Collapse file tree 1 file changed +67
-0
lines changed Expand file tree Collapse file tree 1 file changed +67
-0
lines changed Original file line number Diff line number Diff line change
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 >  ; </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 >  ; </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  ; result format is in the following example.</p >
37
+
38
+ <p >  ; </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 >
You can’t perform that action at this time.
0 commit comments