Skip to content

Commit 35ca53b

Browse files
committed
Update 1667. Fix Names in a Table.sql
1 parent 4404a76 commit 35ca53b

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
1667. Fix Names in a Table
2+
Solved
3+
Easy
4+
Topics
5+
Companies
6+
SQL Schema
7+
Pandas Schema
8+
Table: Users
9+
10+
+----------------+---------+
11+
| Column Name | Type |
12+
+----------------+---------+
13+
| user_id | int |
14+
| name | varchar |
15+
+----------------+---------+
16+
user_id is the primary key (column with unique values) for this table.
17+
This table contains the ID and the name of the user. The name consists of only lowercase and uppercase characters.
18+
19+
20+
Write a solution to fix the names so that only the first character is uppercase and the rest are lowercase.
21+
22+
Return the result table ordered by user_id.
23+
24+
The result format is in the following example.
25+
26+
27+
28+
Example 1:
29+
30+
Input:
31+
Users table:
32+
+---------+-------+
33+
| user_id | name |
34+
+---------+-------+
35+
| 1 | aLice |
36+
| 2 | bOB |
37+
+---------+-------+
38+
Output:
39+
+---------+-------+
40+
| user_id | name |
41+
+---------+-------+
42+
| 1 | Alice |
43+
| 2 | Bob |
44+
+---------+-------+

0 commit comments

Comments
 (0)