Computer Science Homework Help

Ivy Tech Community College SQL Recursive Function Question

 

I’m working on a databases multi-part question and need a reference to help me learn.

Suppose you are given a relation connection(X, Y, Dep, Arr), where a tuple in the relation indicates that there is a train from X to Y, departing at time Dep and arriving at time Arr.

Write a recursive function to find all cities reachable from Evansville, possibly via a sequence of connections. Don’t worry about departure and arrival times.

Modify the function to find cities reachable using a sequence of connections such that the stopover at any intermediate city is not more than 3 hours and not less than 1 hour.