1. Học hỏi
  2. /
  3. Khoa Học
  4. /
  5. Writing Functions and Stored Procedures in SQL Server

Connected

Bài tập

Test FUNCTIONs

Now it's time to test the three functions you wrote in the previous exercise.

Hướng dẫn

100 XP
  • Display the first 100 records of PickupDate, TripDistance and FareAmount from YellowTripData.
  • Determine the shift value of PickupDate by passing the hour value to dbo.GetShiftNumber function; display the shift and include it in the WHERE clause for shifts = 2 only.
  • Convert TripDistance to kilometers with dbo.ConvertMiletoKm function.
  • Convert FareAmount to Euro (with exchange rate of 0.87) with the dbo.ConvertDollar function.