All practice problems Bug of the Day: a new problem every midnight, free for everyone. Keep a streak with your friends.
Data Engineering · SQL · Intermediate
SQL interview question: The Rider
Which rider was last responsible for shipment 7731? Someone brought it to Hub B. It wasn't who the shipment says.
The problem
- Which rider was last responsible for shipment 7731?
You'll use: SQL (SQLite) · SELECT & WHERE · JOIN · GROUP BY · TRIM & datetime() · Data cleaning
Solve it free in your browser3–6 min · You write SQL
Show a hint
shipments.rider_id is set when the shipment is created. Can riders change mid-route?
What this teaches (spoiler)
Current-state columns lose history. When things can change, model them as events (an assignments table) and query the latest event.