From the course: MySQL Essential Training (2019)

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Case conversion

Case conversion

- [Instructor] MySQL has a couple of simple functions for converting the case of strings. For this lesson we use the scratch database. So I'll say use scratch and execute, and now I'm going to select upper of name from customer, and when I execute this, you see that all the names now are in all upper case. UCASE is an alias for upper, so I can say UCASE and get exactly the same result. I can say lower for the function name, and you'll notice that now all the names are in all lower case, and likewise, LCASE is an alias for lower. Oddly, MySQL does not have any functions for title case or sends case, you can get an initial cap with substrings, but it's no substitute for an actual function. So, for example, and again, this is very cumbersome, I can say CONCAT, and I'll use the upper function for just the first character of the string, so I'm saying substring, we'll cover substrings later in this chapter, of name comma one comma one, so that's the one character at the first position, and…

Contents