Use EDA to find impossible scenarios
Calculate how many YellowTripData records have each type of error discovered during EDA.
Bu egzersiz, kursun bir parçasıdır
Writing Functions and Stored Procedures in SQL Server
Egzersiz talimatları
- Use
CASEandCOUNTto understand how many records contain the following errors: DropOffDatebeforePickupDate,DropOffDatebefore today,PickupDatebefore today,TripDistanceis zero.
Uygulamalı etkileşimli egzersiz
Bu egzersizi bu örnek kodu tamamlayarak deneyin.
SELECT
-- PickupDate is after today
COUNT (CASE WHEN ___ > ___() THEN 1 END) AS 'FuturePickup',
-- DropOffDate is after today
COUNT (CASE WHEN ___ > ___() THEN 1 END) AS 'FutureDropOff',
-- PickupDate is after DropOffDate
COUNT (CASE WHEN ___ > ___ THEN 1 END) AS 'PickupBeforeDropoff',
-- TripDistance is 0
COUNT (CASE WHEN ___ = ___ THEN 1 END) AS 'ZeroTripDistance'
FROM YellowTripData;