Skip to content

Commit bc9cfed

Browse files
committed
Upload 158
1 parent f317289 commit bc9cfed

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ Because this project necessitated a framework to enable consistent daily practic
186186
| 155 | [Actors and Directors Who Cooperated At Least Three Times](https://leetcode.com/problems/actors-and-directors-who-cooperated-at-least-three-times/description/) | [Solution](solutions/155_actors_and_directors_who_cooperated_at_least_three_times.md) | LeetCode | Easy | |
187187
| 156 | [Top Travellers](https://leetcode.com/problems/top-travellers/description/) | [Solution](solutions/156_top_travellers.md) | LeetCode | Easy | |
188188
| 157 | [Rearrange Products Table](https://leetcode.com/problems/rearrange-products-table/description/) | [Solution](solutions/157_rearrange_products_table.md) | LeetCode | Easy | |
189+
| 158 | [Calculate Special Bonus](https://leetcode.com/problems/calculate-special-bonus/description/) | [Solution](solutions/158_calculate_special_bonus.md) | LeetCode | Easy | |
189190
<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
190191
<!--- cSpell:enable --->
191192

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SQL Everyday \#158
2+
3+
## Calculate Special Bonus
4+
5+
Site: LeetCode\
6+
Difficulty per Site: Easy
7+
8+
## Problem
9+
10+
Write a solution to calculate the bonus of each employee. The bonus of an employee is `100%` of their salary if the ID of the employee is *an odd number* and *the employee's name does not start with the character* `'M'`. The bonus of an employee is `0` otherwise.
11+
12+
Return the result table ordered by `employee_id`. [[Full Description](https://leetcode.com/problems/calculate-special-bonus/description/)]
13+
14+
## Submitted Solution
15+
16+
```sql
17+
-- Submitted Solution
18+
SELECT
19+
employee_id
20+
,CASE WHEN name NOT LIKE 'M%' AND employee_id % 2 != 0 THEN salary ELSE 0 END AS bonus
21+
FROM Employees
22+
ORDER BY employee_id ASC
23+
;
24+
```
25+
26+
## Site Solution
27+
28+
```sql
29+
-- LeetCode Solution
30+
-- TBD
31+
```
32+
33+
## Notes
34+
35+
TBD
36+
37+
## NB
38+
39+
TBD
40+
41+
Go to [Index](../?tab=readme-ov-file#index)\
42+
Go to [Overview](../?tab=readme-ov-file)

0 commit comments

Comments
 (0)