Skip to content

Commit 66932aa

Browse files
committed
Upload 137
1 parent 29abfe2 commit 66932aa

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ The problems and both submitted and site solutions are documented in individual
169169
| 134 | [Friend Requests II: Who Has the Most Friends](https://leetcode.com/problems/friend-requests-ii-who-has-the-most-friends/description/) | [Solution](solutions/134_friend_requests_ii_who_has_the_most_friends.md) | LeetCode | Medium | `UNION ALL` |
170170
| 135 | [Investments in 2016](https://leetcode.com/problems/investments-in-2016/description/) | [Solution](solutions/135_investments_in_2016.md) | LeetCode | Medium | |
171171
| 136 | [Department Top Three Salaries](https://leetcode.com/problems/department-top-three-salaries/description/) | [Solution](solutions/136_department_top_three_salaries.md) | LeetCode | Hard | |
172+
| 137 | [Fix Names in a Table](https://leetcode.com/problems/fix-names-in-a-table/description/) | [Solution](solutions/137_fix_names_in_a_table.md) | LeetCode | Easy | `SUBSTRING()` |
172173
<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
173174

174175
## Author(s)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SQL Everyday \#137
2+
3+
## Fix Names in a Table
4+
5+
Site: LeetCode\
6+
Difficulty per Site: Easy
7+
8+
## Problem
9+
10+
Write a solution to fix the names so that only the first character is uppercase and the rest are lowercase.
11+
12+
Return the result table ordered by `user_id`. [[Full Description](https://leetcode.com/problems/fix-names-in-a-table/description/)]
13+
14+
## Submitted Solution
15+
16+
```sql
17+
-- Submitted Solution
18+
SELECT
19+
user_id
20+
,CONCAT(UPPER(SUBSTRING(name, 1, 1)), LOWER(SUBSTRING(name FROM 2))) AS name
21+
FROM Users
22+
ORDER BY user_id
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+
`SUBSTRING()`
40+
41+
Go to [Index](../?tab=readme-ov-file#index)\
42+
Go to [Overview](../?tab=readme-ov-file)
43+

0 commit comments

Comments
 (0)