Follow this question for importing data from CSV to mysql. You have to have two tables origins
and distinations
or better yet create temporary tables origins
and distinations
. Once you have imported data in mysql, You can get your result by applying cross product on both tables like this
INSERT INTO yourResultingTable
(origins, destinations)
SELECT origins.origin, destination.destination FROM origins, destinations;