Skip to content

Commit 2dae9f2

Browse files
add 1873
1 parent e21914a commit 2dae9f2

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

database/_1873.sql

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Write your PostgreSQL query statement below
2+
with employee_bonus as (
3+
select employee_id, salary as bonus from Employees where name not like 'M%' and employee_id % 2 = 1
4+
),
5+
non_employee_bonus as (
6+
select employee_id, 0 as bonus from Employees where employee_id not in (
7+
select employee_id from employee_bonus
8+
))
9+
10+
select * from employee_bonus
11+
union
12+
select * from non_employee_bonus
13+
order by employee_id

paginated_contents/database/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
| 2072 |[The Winner University](https://leetcode.com/problems/the-winner-university/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_2072.sql) || Easy |
99
| 2026 |[Low-Quality Problems](https://leetcode.com/problems/low-quality-problems/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_2026.sql) || Easy |
1010
| 1978 |[Employees Whose Manager Left the Company](https://leetcode.com/problems/employees-whose-manager-left-the-company/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1978.sql) || Easy |
11+
| 1873 |[Calculate Special Bonus](https://leetcode.com/problems/calculate-special-bonus/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1873.sql) || Easy |
1112
| 1853 |[Convert Date Format](https://leetcode.com/problems/convert-date-format/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1853.sql) || Easy |
1213
| 1821 |[Find Customers With Positive Revenue this Year](https://leetcode.com/problems/find-customers-with-positive-revenue-this-year/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1821.sql) || Easy |
1314
| 1809 |[Ad-Free Sessions](https://leetcode.com/problems/ad-free-sessions/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1809.sql) || Easy |

0 commit comments

Comments
 (0)