Travelers Interview Question

What is the most complex SQL you have written