课程: Program Databases with Transact-SQL

今天就学习课程吧!

今天就开通帐号,24,100 门业界名师课程任您挑!

Challenge: Create a function

Challenge: Create a function

(upbeat music) - [Illustrator] We've spent some time exploring functions, and I'd like to challenge you to write one on your own. In the Wide World Importers database in the warehouse.coldroomtemperatures table, we have some temperature measurements. I'd like you to create a function that evaluates these temperatures and returns a text description. If the temperature is less than 3.5 degrees, the function should return the text to cold. If the temperature is above four degrees, that it should return the text too hot. And if the temperature is within the range of 3.5 to four, then the function should return just right. See if you can create the function to evaluate a single number that you pass in as a parameter, then apply that function to analyze the values stored in the cold room temperatures table. I estimate that this challenge should take about 10 minutes to complete. In the next movie, I'll walk through the process that I would take to arrive at a solution. Good luck.

内容