Skip to content

Commit d5c1626

Browse files
committed
Upload 148
1 parent e6eee78 commit d5c1626

File tree

4 files changed

+42
-26
lines changed

4 files changed

+42
-26
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ celerybeat.pid
120120
*.sage.py
121121

122122
# Environments
123-
# .env
123+
.env
124124
.venv
125125
env/
126126
venv/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ The problems and both submitted and site solutions are documented in individual
180180
| 145 | [Game Play Analysis I](https://leetcode.com/problems/game-play-analysis-i/description/) | [Solution](solutions/145_game_play_analysis_i.md) | LeetCode | Easy | |
181181
| 146 | [Department Highest Salary](https://leetcode.com/problems/department-highest-salary/description/) | [Solution](solutions/146_department_highest_salary.md) | LeetCode | Medium | |
182182
| 147 | [Customer Placing the Largest Number of Orders](https://leetcode.com/problems/customer-placing-the-largest-number-of-orders/description/) | [Solution](solutions/147_customer_placing_the_largest_number_of_orders.md) | LeetCode | Easy | `ORDER BY` w/ Aggregate Function |
183+
| 148 | [Swap Salary](https://leetcode.com/problems/swap-salary/description/) | [Solution](solutions/148_swap_salary.md) | LeetCode | Easy | |
183184
<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
184185

185186
## 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": "58185a628cb44ff3a82c1c38f2ad4569",
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",

solutions/148_swap_salary.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SQL Everyday \#148
2+
3+
## Swap Salary
4+
5+
Site: LeetCode\
6+
Difficulty per Site: Easy
7+
8+
## Problem
9+
10+
Write a solution to swap all `'f'` and `'m'` values (i.e., change all `'f'` values to `'m'` and vice versa) with a *single update statement* and no intermediate temporary tables.
11+
12+
Note that you must write a single update statement, *do not* write any select statement for this problem. [[Full Description](https://leetcode.com/problems/swap-salary/description/)]
13+
14+
## Submitted Solution
15+
16+
```sql
17+
-- Submitted Solution
18+
UPDATE Salary
19+
SET sex = (CASE WHEN sex = 'f' THEN 'm' ELSE 'f' END)
20+
```
21+
22+
## Site Solution
23+
24+
```sql
25+
-- LeetCode Solution
26+
-- TBD
27+
```
28+
29+
## Notes
30+
31+
TBD
32+
33+
## NB
34+
35+
TBD
36+
37+
Go to [Index](../?tab=readme-ov-file#index)\
38+
Go to [Overview](../?tab=readme-ov-file)

0 commit comments

Comments
 (0)