CREATE FUNCTIONs
Create three functions to help solve the business case:
- Convert distance from miles to kilometers.
- Convert currency based on exchange rate parameter.
(These two functions should return a numeric value with precision of 18 and 2 decimal places.) - Identify the driver shift based on the hour parameter value passed.
Latihan ini adalah bagian dari kursus
Writing Functions and Stored Procedures in SQL Server
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
-- Create the function
___ ___ dbo.ConvertMileToKm (___ numeric(18,2))
-- Specify return data type
___ numeric(18,2)
AS
BEGIN
RETURN
-- Convert Miles to Kilometers
(___ ___ * 1.609)
END;