MySQL - UPPER & LOWER

임재현·2021년 4월 30일
0

MySQL

목록 보기
20/52

UDEMY - The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert를 보고 정리하며 쓴 글

MySQL - UPPER & LOWER

UPPER 공식문서
LOWER 공식문서

UPPER : 대문자로 바꿔주는 함수

mysql> SELECT UPPER ('Hello World');
+-----------------------+
| UPPER ('Hello World') |
+-----------------------+
| HELLO WORLD           |
+-----------------------+
1 row in set (0.00 sec)

LOWER : 소문자로 바꿔주는 함수

mysql> SELECT LOWER('Hello World');
+----------------------+
| LOWER('Hello World') |
+----------------------+
| hello world          |
+----------------------+
1 row in set (0.00 sec)
mysql> SELECT CONCAT('MY FAVORITE BOOK IS THE ',UPPER(title)) FROM books;
+-----------------------------------------------------------------------------+
| CONCAT('MY FAVORITE BOOK IS THE ',UPPER(title))                             |
+-----------------------------------------------------------------------------+
| MY FAVORITE BOOK IS THE THE NAMESAKE                                        |
| MY FAVORITE BOOK IS THE NORSE MYTHOLOGY                                     |
| MY FAVORITE BOOK IS THE AMERICAN GODS                                       |
| MY FAVORITE BOOK IS THE INTERPRETER OF MALADIES                             |
| MY FAVORITE BOOK IS THE A HOLOGRAM FOR THE KING: A NOVEL                    |
| MY FAVORITE BOOK IS THE THE CIRCLE                                          |
| MY FAVORITE BOOK IS THE THE AMAZING ADVENTURES OF KAVALIER & CLAY           |
| MY FAVORITE BOOK IS THE JUST KIDS                                           |
| MY FAVORITE BOOK IS THE A HEARTBREAKING WORK OF STAGGERING GENIUS           |
| MY FAVORITE BOOK IS THE CORALINE                                            |
| MY FAVORITE BOOK IS THE WHAT WE TALK ABOUT WHEN WE TALK ABOUT LOVE: STORIES |
| MY FAVORITE BOOK IS THE WHERE I'M CALLING FROM: SELECTED STORIES            |
| MY FAVORITE BOOK IS THE WHITE NOISE                                         |
| MY FAVORITE BOOK IS THE CANNERY ROW                                         |
| MY FAVORITE BOOK IS THE OBLIVION: STORIES                                   |
| MY FAVORITE BOOK IS THE CONSIDER THE LOBSTER                                |
+-----------------------------------------------------------------------------+
16 rows in set (0.00 sec)


mysql> SELECT CONCAT('MY FAVORITE BOOK IS THE ',LOWER(title)) FROM books;
+-----------------------------------------------------------------------------+
| CONCAT('MY FAVORITE BOOK IS THE ',LOWER(title))                             |
+-----------------------------------------------------------------------------+
| MY FAVORITE BOOK IS THE the namesake                                        |
| MY FAVORITE BOOK IS THE norse mythology                                     |
| MY FAVORITE BOOK IS THE american gods                                       |
| MY FAVORITE BOOK IS THE interpreter of maladies                             |
| MY FAVORITE BOOK IS THE a hologram for the king: a novel                    |
| MY FAVORITE BOOK IS THE the circle                                          |
| MY FAVORITE BOOK IS THE the amazing adventures of kavalier & clay           |
| MY FAVORITE BOOK IS THE just kids                                           |
| MY FAVORITE BOOK IS THE a heartbreaking work of staggering genius           |
| MY FAVORITE BOOK IS THE coraline                                            |
| MY FAVORITE BOOK IS THE what we talk about when we talk about love: stories |
| MY FAVORITE BOOK IS THE where i'm calling from: selected stories            |
| MY FAVORITE BOOK IS THE white noise                                         |
| MY FAVORITE BOOK IS THE cannery row                                         |
| MY FAVORITE BOOK IS THE oblivion: stories                                   |
| MY FAVORITE BOOK IS THE consider the lobster                                |
+-----------------------------------------------------------------------------+
16 rows in set (0.00 sec)
profile
임재현입니다.

0개의 댓글