From the course: From Excel to SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

UPPER, LOWER, and LENGTH in SQL

UPPER, LOWER, and LENGTH in SQL

From the course: From Excel to SQL

Start my 1-month free trial

UPPER, LOWER, and LENGTH in SQL

- [Instructor] So some functions you might find useful in SQL especially when working with text data are the UPPER, LOWER and LENGTH functions. To demonstrate how these work, I've created a simple SQL statement and we'll update the SELECT to include these functions. So let's first look at the UPPER function. We pass UPPER a column name, and what it'll do is return that column name but with all the data inside it change to upper case. So let's run the query. And now you can see all the first names are now in upper case. We can change UPPER to LOWER, and then rerun the query. And we'll see now that all the first names are in lowercase. To show the LENGTH function, we just replace LOWER with LENGTH, and now when we run the query, we find out the length of each of the first names within the column. You can also make use of these functions within the WHERE clause. So for instance, if you want to find out first names…

Contents