Travelers interview question

What is the most complex SQL you have written