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

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.…

Contents