1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 11:08:15 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/originData/fix-names-in-a-table.json

77 lines
5.9 KiB
JSON
Raw Normal View History

2022-03-27 20:45:09 +08:00
{
"data": {
"question": {
"questionId": "1811",
"questionFrontendId": "1667",
"categoryTitle": "Database",
"boundTopicId": 499879,
"title": "Fix Names in a Table",
"titleSlug": "fix-names-in-a-table",
"content": "<p>Table: <code>Users</code></p>\n\n<pre>\n+----------------+---------+\n| Column Name | Type |\n+----------------+---------+\n| user_id | int |\n| name | varchar |\n+----------------+---------+\nuser_id is the primary key for this table.\nThis table contains the ID and the name of the user. The name consists of only lowercase and uppercase characters.\n</pre>\n\n<p>&nbsp;</p>\n\n<p>Write an SQL query to fix the names so that only the first character is uppercase and the rest are lowercase.</p>\n\n<p>Return the result table ordered by <code>user_id</code>.</p>\n\n<p>The query result format is in the following example.</p>\n\n<p>&nbsp;</p>\n<p><strong>Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nUsers table:\n+---------+-------+\n| user_id | name |\n+---------+-------+\n| 1 | aLice |\n| 2 | bOB |\n+---------+-------+\n<strong>Output:</strong> \n+---------+-------+\n| user_id | name |\n+---------+-------+\n| 1 | Alice |\n| 2 | Bob |\n+---------+-------+\n</pre>\n",
"translatedTitle": "修复表中的名字",
"translatedContent": "<p>表: <code>Users</code></p>\n\n<pre>\n+----------------+---------+\n| Column Name | Type |\n+----------------+---------+\n| user_id | int |\n| name | varchar |\n+----------------+---------+\nuser_id 是该表的主键。\n该表包含用户的 ID 和名字。名字仅由小写和大写字符组成。\n</pre>\n\n<p>&nbsp;</p>\n\n<p>编写一个 SQL 查询来修复名字,使得只有第一个字符是大写的,其余都是小写的。</p>\n\n<p>返回按 <code>user_id</code> 排序的结果表。</p>\n\n<p>查询结果格式示例如下。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>\nUsers table:\n+---------+-------+\n| user_id | name |\n+---------+-------+\n| 1 | aLice |\n| 2 | bOB |\n+---------+-------+\n<strong>输出:</strong>\n+---------+-------+\n| user_id | name |\n+---------+-------+\n| 1 | Alice |\n| 2 | Bob |\n+---------+-------+</pre>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 9,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
"contributors": [],
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false}",
"topicTags": [
{
"name": "Database",
"slug": "database",
"translatedName": "数据库",
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": [
{
"lang": "MySQL",
"langSlug": "mysql",
"code": "# Write your MySQL query statement below",
"__typename": "CodeSnippetNode"
},
{
"lang": "MS SQL Server",
"langSlug": "mssql",
"code": "/* Write your T-SQL query statement below */",
"__typename": "CodeSnippetNode"
},
{
"lang": "Oracle",
"langSlug": "oraclesql",
"code": "/* Write your PL/SQL query statement below */",
"__typename": "CodeSnippetNode"
}
],
2022-03-29 16:56:27 +08:00
"stats": "{\"totalAccepted\": \"3.2K\", \"totalSubmission\": \"5.3K\", \"totalAcceptedRaw\": 3195, \"totalSubmissionRaw\": 5310, \"acRate\": \"60.2%\"}",
2022-03-27 20:45:09 +08:00
"hints": [],
"solution": null,
"status": null,
"sampleTestCase": "{\"headers\":{\"Users\":[\"user_id\",\"name\"]},\"rows\":{\"Users\":[[1,\"aLice\"],[2,\"bOB\"]]}}",
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Users (user_id int, name varchar(40))\"\n ],\n \"mssql\": [\n \"Create table Users (user_id int, name varchar(40))\"\n ],\n \"oraclesql\": [\n \"Create table Users (user_id int, name varchar(40))\"\n ],\n \"database\": true\n}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"Create table If Not Exists Users (user_id int, name varchar(40))",
"Truncate table Users",
"insert into Users (user_id, name) values ('1', 'aLice')",
"insert into Users (user_id, name) values ('2', 'bOB')"
],
"enableRunCode": true,
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "{\"headers\":{\"Users\":[\"user_id\",\"name\"]},\"rows\":{\"Users\":[[1,\"aLice\"],[2,\"bOB\"]]}}",
"__typename": "QuestionNode"
}
}
}