From the course: SQL: Data Reporting and Analysis
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Use string functions on your data - SQL Tutorial
From the course: SQL: Data Reporting and Analysis
Use string functions on your data
- In this section we're going to look at string functions. A function is just a formula, and string just means text. So a string function is a formula that you can use on text. SQL provides lots of functions to manipulate your data, which saves you having to download it and then manipulate your data in Excel or some other package. But it's really important to know which data type you're dealing with because some of the functions will only work on numbers or dates or strings. And we are focusing ourselves on strings here. So the first one we're looking at is length, and like most functions or formulas, you use the function name, which can be in upper or lower case, then parenthesis, and the thing you're trying to measure, typically a field name, goes inside the brackets. So if we click go, we can see Penelope has eight characters, Nick has four, Ed has two, et cetera. Notice that if you're using Microsoft the function 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
-
-
-
-
-