From the course: Querying Microsoft SQL Server 2022
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
String functions - SQL Server Tutorial
From the course: Querying Microsoft SQL Server 2022
String functions
- [Instructor] String functions are used to manipulate text values stored in a data table. Let's take a look at a couple by first writing out a simple query that pulls out the First and Last Name columns from the Person.Person table. This query will just return the names from the table and we can see that we have over 19,000 records to work with. Now let's process all of these names to convert their case. The UPPER function will return text converted into all uppercase characters. To use it, I'll open a parenthesis after the name UPPER, and supply the column that I want to process. Let's process the first name values. Then I'll give this column an alias and I'll call it as uppercase. There's also a built in LOWER function that does the same thing, but it converts everything to lowercase letters. I'll use it to process the last name data. If you execute the query, you'll see we have four columns now, and the first…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Use functions in T-SQL3m 10s
-
(Locked)
String functions3m 44s
-
(Locked)
Text concatenation3m 40s
-
(Locked)
Round with mathematical functions3m 13s
-
(Locked)
Find the GREATEST or LEAST value5m 5s
-
(Locked)
Work with date functions5m 56s
-
(Locked)
FORMAT date and times3m 36s
-
(Locked)
Group dates into buckets6m 10s
-
(Locked)
Return random records with NEWID2m 22s
-
(Locked)
Create a series of values5m 13s
-
(Locked)
The IIF logical function3m 39s
-
(Locked)
Write a CASE statement4m 34s
-
(Locked)
Challenge: Use functions in a SQL query49s
-
(Locked)
Solution: Use functions in a SQL query13m 55s
-
(Locked)
Solution: Use functions in a query4m 22s
-
-
-
-
-
-