mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
42 lines
937 B
HTML
42 lines
937 B
HTML
<p>表: <code>Users</code></p>
|
||
|
||
<pre>
|
||
+----------------+---------+
|
||
| Column Name | Type |
|
||
+----------------+---------+
|
||
| user_id | int |
|
||
| name | varchar |
|
||
+----------------+---------+
|
||
user_id 是该表的主键。
|
||
该表包含用户的 ID 和名字。名字仅由小写和大写字符组成。
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p>编写一个 SQL 查询来修复名字,使得只有第一个字符是大写的,其余都是小写的。</p>
|
||
|
||
<p>返回按 <code>user_id</code> 排序的结果表。</p>
|
||
|
||
<p>查询结果格式示例如下。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>
|
||
Users table:
|
||
+---------+-------+
|
||
| user_id | name |
|
||
+---------+-------+
|
||
| 1 | aLice |
|
||
| 2 | bOB |
|
||
+---------+-------+
|
||
<strong>输出:</strong>
|
||
+---------+-------+
|
||
| user_id | name |
|
||
+---------+-------+
|
||
| 1 | Alice |
|
||
| 2 | Bob |
|
||
+---------+-------+</pre>
|