NYCの区別統計の結果
作成したばかりのストアドプロシージャ dbo.cuspBoroughRideStats の結果を確認しましょう。
この演習はコースの一部です
SQL Server における関数とストアドプロシージャの作成
演習の手順
@SPResultsをTABLEとして宣言し、nvarchar (30)型の列Weekday、Borough、AvgFarePerKM、RideCount、TotalRideMinを用意します。dbo.cuspBoroughRideStatsを実行し、結果を@SPResultsに挿入します。@SPresultsからすべてのレコードを選択します。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
-- Create SPResults
___ ___ ___(
-- Create Weekday
___ nvarchar(30),
-- Create Borough
___ nvarchar(30),
-- Create AvgFarePerKM
___ nvarchar(30),
-- Create RideCount
___ nvarchar(30),
-- Create TotalRideMin
___ nvarchar(30))
-- Insert the results into @SPResults
___ ___ ___
-- Execute the SP
___ ___.___
-- Select all the records from @SPresults
___ ___
___ ___;