Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Quiz
11. Complex recursive CTE – graphs
Summary

Instruction

Amazing! The last recursion question is about graphs.

Exercise

One of the project managers needs to travel around four cites in France, and he needs to do it as quickly as possible. His friends from the development team decided to help him. We've created two new tables: city (with the id and name of each city) and road (with city_from, city_to and the time required to travel).

The manager starts in Paris. Your task is to find the path with the shortest amount of total travel time.

In your answer, provide the following columns:

  • path – City names, separated by '->'.
  • last_id – The ID of the last city.
  • total_time – The total time spent driving.
  • count_places – The number of places visited, which should equal 4.