#118. [LeetCode / MySQL] 1667. Fix Names in a Table

문제

 

 

입력 코드

SELECT user_id, 
       CONCAT(UPPER(LEFT(name, 1)), LCASE(SUBSTRING(name, 2))) AS name
FROM Users
ORDER BY user_id
SELECT user_id, 
       CONCAT(UPPER(SUBSTRING(name, 1, 1)), LOWER(SUBSTRING(name, 2))) AS name
FROM Users
ORDER BY user_id
SELECT user_id, 
       CONCAT(UPPER(SUBSTR(name, 1, 1)), LOWER(RIGHT(name, LENGTH(name)-1))) AS name
FROM Users
ORDER BY user_id

 

 

 

코드 설명

#SELECT #CONCAT #UPPER #LOWER #LEFT #RIGHT #LCASE #SUBSTRING #SUBSTR #LENGTH #ORDER BY

 

 

문제 출처

https://leetcode.com/problems/fix-names-in-a-table/description/?envType=study-plan-v2&envId=top-sql-50