Q1:計算成本
答:有在電信SQL Server數據庫的兩個表 - 客戶和價格如下圖所示:
客戶
PK CustomerPhoneNumber varchar(15) CustomerType int -the type of customer
價格
FK CustomerType int - the type of customer CountryCode varchar(4) – the country calling code Rate float - the rate per minute of phone call
實例國家代碼:
1 – USA 1809 – Dominican Republic 44 – Great Britain 359 – Bulgaria
因此,在美國的電話號碼是13104405609.
正如率取決於客戶類型,並呼籲該國表所示。
鑑於呼叫的完整始發號碼和目的地電話號碼(包括國家代碼)及其持續時間(分鐘),編寫單個SQL語句來計算呼叫成本。
爲方便起見,讓SQL語句的參數被稱爲@FromPhoneNumber,@ToPhoneNumber,@Duration。
改善筆記將有助於... – 2010-02-06 00:38:02
作業嗎? – 2010-02-06 00:45:29
我在猜測作業。這當然寫作功課。 – Aaronaught 2010-02-06 00:46:51