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 - SQL Tutorial
From the course: SQL: Data Reporting and Analysis
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
-
-
-
-
Retrieve data with SELECT5m 31s
-
(Locked)
Filter results with the WHERE clause5m 4s
-
(Locked)
Use LIKE, IN, and wildcards with WHERE5m 39s
-
(Locked)
Sort SQL results with ORDER BY1m 42s
-
(Locked)
Use string functions on your data6m 41s
-
(Locked)
More advanced string functions8m 35s
-
(Locked)
Change report headings with an alias2m 28s
-
(Locked)
Use date functions with WHERE8m 50s
-
(Locked)
Challenge: Query a table1m 7s
-
(Locked)
Solution: Query a table1m 23s
-
(Locked)
Challenge: Convert case50s
-
(Locked)
Solution: Convert case2m 30s
-
-
-
-
-