紐約市行政區統計結果
來查看你剛剛建立的儲存程序 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
___ ___
___ ___;