Merging trip_info and sex table, then sorting and outputting to the database in a new table