Skip to content

Commit 2dabb75

Browse files
committed
Upload 129
1 parent 9262b72 commit 2dabb75

File tree

3 files changed

+55
-25
lines changed

3 files changed

+55
-25
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ To make the daily tasks of creating a new file and updating the index easier, th
163163
| 126 | [Triangle Judgement](https://leetcode.com/problems/triangle-judgement/description/) | [Solution](solutions/126_triangle_judgement.md) | LeetCode | Easy | Triangle Inequality Theorem |
164164
| 127 | [Consecutive Numbers](https://leetcode.com/problems/consecutive-numbers/description/) | [Solution](solutions/127_consecutive_numbers.md) | LeetCode | Medium | |
165165
| 128 | [Last Person to Fit in the Bus](https://leetcode.com/problems/last-person-to-fit-in-the-bus/description/) | [Solution](solutions/128_last_person_to_fit_in_the_bus.md) | LeetCode | Medium | `ORDER BY turn RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW` |
166+
| 129 | [Count Salary Categories](https://leetcode.com/problems/count-salary-categories/description/) | [Solution](solutions/129_count_salary_categories.md) | LeetCode | Medium | `IFNULL` |
166167
<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
167168

168169
## Author(s)

eevveerryyddaayy.ipynb

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,9 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": null,
66
"metadata": {},
7-
"outputs": [
8-
{
9-
"data": {
10-
"application/vnd.jupyter.widget-view+json": {
11-
"model_id": "7cbae60fa8194cafb94186940696bbcf",
12-
"version_major": 2,
13-
"version_minor": 0
14-
},
15-
"text/plain": [
16-
"VBox(children=(VBox(children=(HTML(value='<span style=\"font-size:20px;\"><b>EEVVEERRYYDDAAYY</b></span>', layou…"
17-
]
18-
},
19-
"metadata": {},
20-
"output_type": "display_data"
21-
},
22-
{
23-
"name": "stdout",
24-
"output_type": "stream",
25-
"text": [
26-
"Processing...\n",
27-
"Done\n"
28-
]
29-
}
30-
],
7+
"outputs": [],
318
"source": [
329
"\"\"\"\n",
3310
"Run this cell to display the form interface.\n",
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SQL Everyday \#129
2+
3+
## Count Salary Categories
4+
5+
Site: LeetCode\
6+
Difficulty per Site: Medium
7+
8+
## Problem
9+
10+
Write a solution to calculate the number of bank accounts for each salary category. [[Full Description](https://leetcode.com/problems/count-salary-categories/description/)]
11+
12+
## Submitted Solution
13+
14+
```sql
15+
-- Submitted Solution
16+
SELECT
17+
"Low Salary" AS category
18+
,IFNULL(COUNT(account_id), 0) AS accounts_count
19+
FROM Accounts
20+
WHERE income < 20000
21+
UNION
22+
SELECT
23+
"Average Salary" AS category
24+
,IFNULL(COUNT(account_id), 0) AS accounts_count
25+
FROM Accounts
26+
WHERE income >= 20000 AND income <= 50000
27+
UNION
28+
SELECT
29+
"High Salary" AS category
30+
,IFNULL(COUNT(account_id), 0) AS accounts_count
31+
FROM Accounts
32+
WHERE income > 50000
33+
;
34+
```
35+
36+
## Site Solution
37+
38+
```sql
39+
-- LeetCode Solution
40+
-- TBD
41+
```
42+
43+
## Notes
44+
45+
TBD
46+
47+
## NB
48+
49+
`IFNULL`
50+
51+
Go to [Table of Contents](/README.md#contents)\
52+
Go to [Overview](/README.md)

0 commit comments

Comments
 (0)