SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Each Rider's Third Completed Trip

Unsolved

Uber's loyalty team triggers a reward on a rider's third completed trip. Only trips with status = 'completed' count toward the sequence; cancelled trips are skipped. Trips are ordered by requested_at, and when two trips have the same requested_at, the lower trip_id comes first. Note that trip_id does not always follow time order. Riders with fewer than three completed trips are left out. Write an SQL query that returns rider_id, trip_id and fare for each rider's third completed trip. Order the results by rider_id ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
🏢 Uber

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM trips
Full source dataset
19 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine