Ranking Records with ROW_NUMBER
Harbr's operations team wants to identify which shipments were fastest within each region - specifically, a ranked list of shipments ordered by delivery time, reset for each region. Rather than sorting the full table and losing regional context, you'll use ROW_NUMBER() with PARTITION BY to assign a rank within each region independently. Your task is to rank shipments by delivery_days (then shipment_id as a tiebreaker) within each region and identify which shipment ranked first in AMER.
Use the table's full path in your ⚠️ Can't select a database, or getting a "table not found" error?
FROM clause. Get it from the left panel: Databases tab → expand your COURSE_… database → select the table → Copy name.
This exercise is part of the course
Data Pipeline Automation in Snowflake
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
Start Exercise