From the course: SQL: Data Reporting and Analysis

Unlock the full course today

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

Solution: Convert case

Solution: Convert case

(upbeat music) - [Instructor] As a quick recap, the challenge here is to return the title field of the film table in proper case. For this challenge you're going to need to use SUBSTR and or a combination of left and right, these are all string functions that return part of a text field. Let's start by returning the part of the string that we want capitalized. We can say SELECT LEFT(title,1) and that's saying the left most character of the title field. And I dunno if you remember, but this top row was academy dinosaur and it's returned A, which is correct. Now these are already an uppercase. So just in case somebody comes along and changes it, we can put up around here, but strictly that shouldn't be necessary. Okay, so we have the first character, now we need the rest. Now, if we were to use the string function called right here we would also need to use the length of function to work out how long the title field is…

Contents