RANK vs DENSE_RANK
Harbr's operations team wants to rank AMER shipments by delivery speed. You'll compare RANK() and DENSE_RANK() on logistics.shipments, which has columns shipment_id, region, and delivery_days. Because several AMER shipments share the same delivery time, the two functions produce noticeably different results.
This exercise is part of the course
Data Pipeline Automation in Snowflake
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
SELECT
shipment_id,
delivery_days,
-- Rank by delivery_days using RANK
___() OVER(ORDER BY ___) AS delivery_rank
FROM logistics.shipments
WHERE region = 'AMER';