Can someone please tell me where I went wrong for an exercise submission?
Makes little sense to me. Can you not approach your lecturer/examiner and request further feedback?

Personally I wouldn't be storing distances - store the coordinates and do the calculation on the fly. If you have 100 cities, then you have to store 99 distances with each city - not very pretty.

An example with MySqL is here. If MySQL has this, I'd be fairly sure that all the other major vendors support this functionality. And they do! Found this also which you may find this helpful. You didn't mention the name of your RDBMS but you should always do so.

Take the tour, check out the help centre and the "Help us to help you" blog. p.s welcome to the forums!