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.
Solution: Use functions in a SQL query - SQL Server Tutorial
From the course: Querying Microsoft SQL Server 2022
Solution: Use functions in a SQL query
(gentle music) - [Instructor] I hope you are able to flex a bit of your new SQL Server function muscles in answering the following questions. Let's take a look and go over each one, one at a time. Now I've got the ChallengeFive-Start file open up here on the screen, and we'll just start here with question number one. It says, using the Production.ProductInventory table, combine the LocationID, Shelf, and Bin values into a single column with hyphens between each one. All right, so let's go ahead and go into the tables folder for the database. And we'll just find the table that we're going to work with, that is Production.ProductInventory. And we can take a look at the columns inside of it. So we have the ProductID column that we're going to use or the LocationID. Then we also have the Shelf and the Bin columns. And these are the ones that we want to combine together. So let's go ahead and start a SELECT statement here.…
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
-
-
-
-
-
-