From the course: Complete Guide to SQL for Data Engineering: from Beginner to Advanced

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

String functions: Changing case and extracting substrings

String functions: Changing case and extracting substrings - SQL Tutorial

From the course: Complete Guide to SQL for Data Engineering: from Beginner to Advanced

String functions: Changing case and extracting substrings

- [Instructor] Assume you are managing a list of your favorite books. Some titles are in all uppercase to grab your attention while others are in lowercase to make you feel more relaxed. We can change the text case and extract a surface string using lot of string functions available in the SQL. Let's just go back to pgAdmin and see how we can play with these strings. Let's say I want to see the name of all my customers in a capital letter. I can say select, upper. I pass the name of my customer, say customer_name from customer table. Now this upper function will give all the names into the uppercase letters. Maybe that sounds too much right? Maybe if I want it into the lowercase. So there is a function exist called lower function. When you run this, it'll give you the result in the lower form or the case of all the result would be of lower case. Upper will be too much. Lower will be too lower. You want something…

Contents