You messed up Q6. You'd need to divide the duration(that is in minutes) by 60 to get the hour. So the correct formula would be AVG(distance/(duration/60)) to get the avg speed in km/h. But the question asked for each runner and each delivery, so the correct query should look something like this: SELECT runner_id, order_id, AVG(distance/(duration/60)) AS avg_speed_kmh FROM runner_orders WHERE cancellation IS NULL GROUP BY runner_id,order_id ORDER BY runner_id, order_id
You can still calculate the speed in km/h when you multiply the speed in km/min by 60. It depends on which method you wish to use. However, you are correct regarding the question for each runner and each delivery. I missed out on that part. Thanks for pointing out.
Thank you, you are doing great help, waiting for part c.
Part C pls
Coming soon!
You messed up Q6.
You'd need to divide the duration(that is in minutes) by 60 to get the hour. So the correct formula would be
AVG(distance/(duration/60)) to get the avg speed in km/h.
But the question asked for each runner and each delivery, so the correct query should look something like this:
SELECT
runner_id,
order_id,
AVG(distance/(duration/60)) AS avg_speed_kmh
FROM runner_orders
WHERE cancellation IS NULL
GROUP BY runner_id,order_id
ORDER BY runner_id, order_id
You can still calculate the speed in km/h when you multiply the speed in km/min by 60. It depends on which method you wish to use. However, you are correct regarding the question for each runner and each delivery. I missed out on that part. Thanks for pointing out.