SQL CASE STUDY #2 PART - B | PIZZA RUNNER | Runner and Customer Experience

Поділитися
Вставка
  • Опубліковано 22 січ 2025

КОМЕНТАРІ • 5

  • @shivamdwivedi5048
    @shivamdwivedi5048 9 днів тому

    Thank you, you are doing great help, waiting for part c.

  • @shravyashetty2242
    @shravyashetty2242 25 днів тому +1

    Part C pls

  • @zsomborb1065
    @zsomborb1065 4 місяці тому

    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

    • @TurnToData
      @TurnToData  4 місяці тому

      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.