Comeet interview question

Optimize a SQL query. It was about 15 lines of code.