im not quite sure how i would go about doing this, i want a user to select a starting location and a destination , and when he does the mileage automatically appears under the mileage section.

i know if i where writing this in java i could use a getStart() function to get the value of the starting location and open the table that matches that value, then do the same for the destination, match it to the destination in the table that was opened and return the corresponding mileage... But i am not sure how to go about doing this with SQL... while im on this subject could i write this out in java and call it somehow from within the database?

i've attached the file so that you can get an idea of what im doing