A delivery is on time if delivered_at is no later than ordered_at plus promised_minutes. For each city (the restaurant's city), compute the on-time rate over all rows in deliveries.
Return city, deliveries and on_time_pct, rounded to 1 decimal place.
Ctrl/⌘ + Enter runs the query. Table and column names are suggested as you type. Press Esc then Tab to leave the editor with the keyboard.
Expected output (8 rows)
Expected output
city
deliveries
on_time_pct
Indore
455
76.3
Mumbai
1834
63.4
Pune
859
61.9
Jaipur
545
72.7
Delhi
1625
63.2
Bengaluru
1731
62.4
Chennai
953
63.5
Hyderabad
1171
62.9
Row order doesn’t matter for this question. Numbers are compared with a tiny tolerance; text must match exactly.
Stuck?
Stored on this device only. Your latest query and “solved” status are remembered in this browser only. They don’t sync between devices, and clearing your browser data removes them.