Skip to content

case #2 PART B QUESTION 2 #21

@Vishesh189

Description

@Vishesh189

In question 2 they asked average time for each runner not for all
Try this code
SELECT r.runner_id, ROUND(AVG(EXTRACT(EPOCH FROM (r.pickup_time - c.order_time))/60),2) AS AVG_TIME FROM
customer_orders_temp c
JOIN runner_orders_temp r ON r.order_id = c.order_id
WHERE distance IS NOT NULL
GROUP BY r.runner_id
ORDER BY r.runner_id

OUTPUT
runner_id avg_time
1 15.68
2 23.72
3 10.47

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions