Skip to content

SQL statement that returns the cheapest tour using a Recursive Query

Notifications You must be signed in to change notification settings

skytecat/TheCheapestRoute_SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The cheapest route SQL

Описание на русском тут.

graph

Technical assignment

Please take a look at the Graph. There are 4 cities (a, b, c and d) and arcs between them with cost (or taxination). Actually the cost (a,b) = (b,a).

Please write one SQL statement using Recursive Query that returns all tours (aka paths) with minimal traveling cost if we will start from city "a".

You need to find the cheapest way of visiting all the cities and returning to your starting point. For example, the tour looks like that a -> b -> c -> d -> a. Please sort data by total_cost and then by tour.

Instructions for running the code

Please download a script with Database Model from src/database/model.sql and apply the script to your database.

Run the script from src/the_cheapest_route.sql

About

SQL statement that returns the cheapest tour using a Recursive Query

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published