File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
1667-fix-names-in-a-table Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ <h2 ><a href =" https://leetcode.com/problems/fix-names-in-a-table/ " >1667. Fix Names in a Table</a ></h2 ><h3 >Easy</h3 ><hr ><div class =" sql-schema-wrapper__3VBi " ><a class =" sql-schema-link__3cEg " >SQL Schema<svg viewBox =" 0 0 24 24 " width =" 1em " height =" 1em " class =" icon__1Md2 " ><path fill-rule =" evenodd " d =" M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z " ></path ></svg ></a ></div ><div ><p >Table: <code >Users</code ></p >
2
+
3
+ <pre >+----------------+---------+
4
+ | Column Name | Type |
5
+ +----------------+---------+
6
+ | user_id | int |
7
+ | name | varchar |
8
+ +----------------+---------+
9
+ user_id is the primary key (column with unique values) for this table.
10
+ This table contains the ID and the name of the user. The name consists of only lowercase and uppercase characters.
11
+ </pre >
12
+
13
+ <p >  ; </p >
14
+
15
+ <p >Write a solution to fix the names so that only the first character is uppercase and the rest are lowercase.</p >
16
+
17
+ <p >Return the result table ordered by <code >user_id</code >.</p >
18
+
19
+ <p >The result format is in the following example.</p >
20
+
21
+ <p >  ; </p >
22
+ <p ><strong class =" example " >Example 1:</strong ></p >
23
+
24
+ <pre ><strong >Input:</strong >
25
+ Users table:
26
+ +---------+-------+
27
+ | user_id | name |
28
+ +---------+-------+
29
+ | 1 | aLice |
30
+ | 2 | bOB |
31
+ +---------+-------+
32
+ <strong >Output:</strong >
33
+ +---------+-------+
34
+ | user_id | name |
35
+ +---------+-------+
36
+ | 1 | Alice |
37
+ | 2 | Bob |
38
+ +---------+-------+
39
+ </pre >
40
+ </div >
You can’t perform that action at this time.
0 commit comments